This repository has been archived on 2026-04-30. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
kingdombattles/src/reducers/combat.js
T
2019-05-29 04:35:53 +10:00

18 lines
389 B
JavaScript

import { SET_ATTACK_DISABLED } from '../actions/combat.js';
const initialStore = {
attackDisabled: false
};
export function combatReducer(store = initialStore, action) {
switch(action.type) {
case SET_ATTACK_DISABLED: {
let newStore = JSON.parse(JSON.stringify(initialStore));
newStore.attackDisabled = action.disabled;
return newStore;
}
default:
return store;
}
}