client/src/reducers/notesReducer.js
author Alexandre Segura <mex.zktk@gmail.com>
Tue, 23 May 2017 16:18:34 +0200
changeset 5 5c91bfa8fcde
parent 3 3b5d37d84cfe
child 12 48ddaa42b810
permissions -rw-r--r--
Introduce SlateJS.

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