client/src/reducers/notesReducer.js
author ymh <ymh.work@gmail.com>
Mon, 19 Jun 2017 21:37:33 +0200
changeset 58 f16a080e0bc4
parent 29 4cfeabef7d5e
child 59 1eb52770eefa
permissions -rw-r--r--
on server, augment default token lifetime and add settings in .env to control it. Add the refresh endpoint

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;
  }
};