Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save factoryhr/2739ecc12a029f1baf12d8c22c397dab to your computer and use it in GitHub Desktop.
Save factoryhr/2739ecc12a029f1baf12d8c22c397dab to your computer and use it in GitHub Desktop.
function createStore(reducer, preloadedState) {
// Store the current state
var currentState = preloadedState;
// Retrieve the current state
function getState() {
return currentState;
}
// Expose the API
return {
getState: getState,
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment