client/src/reducers/notes-reducer.js
changeset 3 3b5d37d84cfe
parent 2 b52921a63e77
child 4 885a20cde527
equal deleted inserted replaced
2:b52921a63e77 3:3b5d37d84cfe
     1 import * as types from '../actions/action-types';
       
     2 import Immutable from 'immutable';
       
     3 
       
     4 const noteRecord = Immutable.Record({id:'', text: ''});
       
     5 
       
     6 export default (state = Immutable.List([]), action) => {
       
     7   switch (action.type) {
       
     8     case types.ADD_NOTE:
       
     9       return state.push(new noteRecord(action.note));
       
    10     default:
       
    11       return state;
       
    12   }
       
    13 };