client/src/reducers/notes-reducer.js
changeset 1 431977d7c9a6
equal deleted inserted replaced
0:d076a27e5631 1:431977d7c9a6
       
     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 };