Switch to redux and webpack
This commit is contained in:
parent
b247287075
commit
e389454535
97 changed files with 2722 additions and 2656 deletions
8
client/src/js/util/createReducer.js
Normal file
8
client/src/js/util/createReducer.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
export default function createReducer(initialState, handlers) {
|
||||
return function reducer(state = initialState, action) {
|
||||
if (handlers.hasOwnProperty(action.type)) {
|
||||
return handlers[action.type](state, action);
|
||||
}
|
||||
return state;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue