Added a dummied attack button as a component

This commit is contained in:
2019-05-29 02:42:49 +10:00
parent b59549a422
commit d7967a0159
9 changed files with 147 additions and 8 deletions
+18
View File
@@ -0,0 +1,18 @@
import { SET_ATTACK_DISABLED } from '../actions/combat.js';
const initialStore = {
attackDisabled: true
};
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;
}
}
+3 -1
View File
@@ -1,8 +1,10 @@
import { combineReducers } from 'redux';
import { accountReducer } from './accounts.js';
import { combatReducer } from './combat.js';
//compile all reducers together
export default combineReducers({
account: accountReducer
account: accountReducer,
combat: combatReducer
});