const dialogReducer = (state = [], action) => { switch(action.type) { case 'dialog_addmsg': return [...state, { msg: action.msg, act: action.act || null }]; case 'dialog_remove_first': return state.slice(1); default: return state; } } export default dialogReducer;