client/src/reducers/notesReducer.js
author Alexandre Segura <mex.zktk@gmail.com>
Tue, 20 Jun 2017 16:08:12 +0200
changeset 63 4088f8dc6b52
parent 62 b2514a9bcd49
child 66 f402435be429
permissions -rw-r--r--
Improve session page layout, introduce summary.

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