message_reducer.js 343 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 import { SAVE_MESSAGE, } from '../_actions/types'; export default function (state = {messages:[]}, action) { switch (action.type) { case SAVE_MESSAGE: return { ...state, messages: state.messages.concat(action.payload) } default: return state; } }