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.
 
 

21 lines
522 B

const Immutable = require('immutable');
import * as MuncherActions from '../../actions/board/muncher.actions';
const initial = { x: 0, y: 0, frozen: false };
const reducer = (state = initial, action) => {
if (action.type !== MuncherActions.MUNCHER_ACTION) {
return state;
}
if (action.action === MuncherActions.UPDATE) {
return Immutable.Map(state)
.set('x', action.x)
.set('y', action.y)
.toObject();
}
return state;
};
export default reducer;