Created
March 27, 2018 06:39
-
-
Save factoryhr/2739ecc12a029f1baf12d8c22c397dab to your computer and use it in GitHub Desktop.
This file contains 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
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