client/src/reducers/notes-reducer.js
author ymh <ymh.work@gmail.com>
Mon, 22 May 2017 14:34:35 +0200
changeset 1 431977d7c9a6
permissions -rw-r--r--
add first react application skeleton

import * as types from '../actions/action-types';
import Immutable from 'immutable';

const noteRecord = Immutable.Record({id:'', text: ''});

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