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.
22 lines
521 B
22 lines
521 B
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;
|
|
|