client/src/reducers/notesReducer.js
author ymh <ymh.work@gmail.com>
Tue, 20 Jun 2017 14:13:15 +0200
changeset 62 b2514a9bcd49
parent 59 1eb52770eefa
child 66 f402435be429
permissions -rw-r--r--
migrate to redux-offline + various optimisation

import Immutable from 'immutable';
import * as types from '../constants/actionTypes';
import NoteRecord from '../store/noteRecord';

export default (state = Immutable.List([]), action) => {
  switch (action.type) {
    case types.ADD_NOTE:
      return state.push(new NoteRecord(action.note));
    case types.LOAD_NOTES_BY_SESSION:
      //return action.notes;
      return state;
    default:
      return state;
  }
};