Skip to content

Instantly share code, notes, and snippets.

@evgenyfedorenko
Created November 11, 2019 20:51
Show Gist options
  • Save evgenyfedorenko/0ad3c55cf6ddf671a0412cfc5628afa3 to your computer and use it in GitHub Desktop.
Save evgenyfedorenko/0ad3c55cf6ddf671a0412cfc5628afa3 to your computer and use it in GitHub Desktop.
function reduceState(stateActionPair = { state: undefined }, [action, reducer]) {
const { state } = stateActionPair;
return { state: reducer(state, action), action };
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment