You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

29 lines
758 B

const Immutable = require('immutable');
import * as MessageActions from '../../actions/board/message.actions';
const initial = { line1: '', line2: '', hidden: true };
const reducer = (state = initial, action) => {
if (action.type !== MessageActions.MESSAGE_ACTION) {
return state;
}
switch (action.action) {
case MessageActions.DISPLAY:
return Immutable.Map(state)
.set('line1', action.line1)
.set('line2', action.line2)
.set('hidden', false)
.toObject();
case MessageActions.HIDE:
return Immutable.Map(state)
.set('hidden', true)
.toObject();
}
return state;
};
export default reducer;