Skip to content

Instantly share code, notes, and snippets.

@agoldis
Created April 27, 2018 05:58
Show Gist options
  • Select an option

  • Save agoldis/94e164f35f9335b9980b4717b1b4e71f to your computer and use it in GitHub Desktop.

Select an option

Save agoldis/94e164f35f9335b9980b4717b1b4e71f to your computer and use it in GitHub Desktop.
redux - full example
import { deriveState } from "./deriveState";
export const enhanceStore = createStore => (
reducer,
preloadedState,
enhancer
) => {
const store = createStore(reducer, preloadedState, enhancer);
const _getState = store.getState;
store.getState = () => deriveState(_getState());
return store;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment