webio-node/src/reducers/dialog.js
2017-03-22 13:35:45 +08:00

15 lines
294 B
JavaScript

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;