const Immutable = require('immutable'); import * as WelcomeActions from '../../actions/welcome/welcome.actions'; const initial = { scores: [] }; const reducer = (state = initial, action) => { if (action.type !== WelcomeActions.WELCOME_ACTION) { return state; } switch (action.action) { case WelcomeActions.UPDATE_SCORES: return Immutable.Map(state) .set('scores', action.scores) .toObject(); } return state; }; export default reducer;