client/src/reducers/notesReducer.js
changeset 62 b2514a9bcd49
parent 59 1eb52770eefa
child 66 f402435be429
equal deleted inserted replaced
61:7586b4a11c32 62:b2514a9bcd49
     1 import Immutable from 'immutable';
     1 import Immutable from 'immutable';
     2 import * as types from '../constants/actionTypes';
     2 import * as types from '../constants/actionTypes';
     3 import noteRecord from '../store/noteRecord';
     3 import NoteRecord from '../store/noteRecord';
     4 
     4 
     5 export default (state = Immutable.List([]), action) => {
     5 export default (state = Immutable.List([]), action) => {
     6   switch (action.type) {
     6   switch (action.type) {
     7     case types.ADD_NOTE:
     7     case types.ADD_NOTE:
     8       return state.push(new noteRecord(action.note));
     8       return state.push(new NoteRecord(action.note));
     9     case types.LOAD_NOTES_BY_SESSION:
     9     case types.LOAD_NOTES_BY_SESSION:
    10       return action.notes;
    10       //return action.notes;
       
    11       return state;
    11     default:
    12     default:
    12       return state;
    13       return state;
    13   }
    14   }
    14 };
    15 };