Last active
November 30, 2017 03:22
-
-
Save VadimBrodsky/7420d9502c023b94ac92d6f5687f0b55 to your computer and use it in GitHub Desktop.
Redux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const combineReducers = (reducers) => { | |
return (state = {}, action) => { | |
return Object.keys(reducers).reduce((nextState, key) => { | |
nextState[key] = reducers[key](state[key], action); | |
return nextState; | |
}, {}); | |
}; | |
}; | |
const todoApp = combineReducers({ | |
todos, | |
visibilityFileter, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment