Skip to content

Instantly share code, notes, and snippets.

@abha57
Last active September 23, 2020 04:09
Show Gist options
  • Select an option

  • Save abha57/8279da1d72a9789286b00ff8b660afb9 to your computer and use it in GitHub Desktop.

Select an option

Save abha57/8279da1d72a9789286b00ff8b660afb9 to your computer and use it in GitHub Desktop.
combineReducers polyfill
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