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