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.
40 lines
1.1 KiB
40 lines
1.1 KiB
const Immutable = require('immutable');
|
|
|
|
import * as WelcomeActions from '../../actions/welcome/welcome.actions';
|
|
|
|
const initial = {
|
|
scores: [
|
|
{ initials: "AAA", score: "0", rank: "1" },
|
|
{ initials: "AAA", score: "0", rank: "1" },
|
|
{ initials: "AAA", score: "0", rank: "1" },
|
|
{ initials: "AAA", score: "0", rank: "1" },
|
|
{ initials: "AAA", score: "0", rank: "1" },
|
|
{ initials: "AAA", score: "0", rank: "1" }
|
|
],
|
|
|
|
initials: [
|
|
{ initial: 'A', active: true },
|
|
{ initial: 'A', active: false },
|
|
{ initial: 'A', active: false }
|
|
]
|
|
};
|
|
|
|
const reducer = (state = initial, action) => {
|
|
if (action.type !== WelcomeActions.WELCOME_ACTION) {
|
|
return state;
|
|
}
|
|
|
|
// if (action.action === WelcomeActions.UPDATE_SCORES) {
|
|
// return action.scores;
|
|
// }
|
|
switch (action.action) {
|
|
case WelcomeActions.UPDATE_INITIALS:
|
|
return Immutable.Map(state)
|
|
.set('initials', action.initials)
|
|
.toObject();
|
|
}
|
|
|
|
return state;
|
|
};
|
|
|
|
export default reducer;
|
|
|