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.
25 lines
698 B
25 lines
698 B
require('immutable');
|
|
import * as GridActions from '../../actions/board/grid.actions';
|
|
import Values from '../Values';
|
|
|
|
const reducer = (state = [], action) => {
|
|
if (action.type !== GridActions.GRID_ACTION) {
|
|
return state;
|
|
}
|
|
|
|
switch (action.action) {
|
|
case GridActions.GENERATE:
|
|
return Values.generate(action.count, action.level);
|
|
case GridActions.UPDATE:
|
|
// const valid = Values.validate(state[action.index], action.level);
|
|
const results = state.slice(0);
|
|
// if (valid) {
|
|
results[action.index] = "";
|
|
// }
|
|
return results;
|
|
}
|
|
|
|
return state;
|
|
};
|
|
|
|
export default reducer;
|
|
|