const Immutable = require('immutable'); import * as ScorebarActions from '../../actions/board/scorebar.actions'; const initial = { current: 0, high: 0, lives: 0 }; const reducer = (state = initial, action) => { if (action.type !== ScorebarActions.SCOREBAR_ACTION) { return state; } return Immutable.Map(state) .set('current', action.currentScore) .set('high', action.highScore) .set('lives', action.lives) .toObject(); }; export default reducer;