client/src/reducers/notesReducer.js
author ymh <ymh.work@gmail.com>
Tue, 20 Jun 2017 19:05:01 +0200
changeset 66 f402435be429
parent 62 b2514a9bcd49
child 79 772b73e31069
permissions -rw-r--r--
Action types cleaning

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));
    default:
      return state;
  }
};