Last active
September 23, 2020 04:09
-
-
Save abha57/8279da1d72a9789286b00ff8b660afb9 to your computer and use it in GitHub Desktop.
combineReducers polyfill
This file contains hidden or 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) => (state = {}, action) => Object.keys(reducers).reduce((nextState, key) => { | |
| nextState[key] = reducers[key](state[key], action); | |
| return nextState; | |
| }, {}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment