client/src/reducers/notes-reducer.js
author ymh <ymh.work@gmail.com>
Mon, 22 May 2017 17:59:19 +0200
changeset 2 b52921a63e77
parent 1 431977d7c9a6
permissions -rw-r--r--
add scss + bootstrap

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