Last active
November 25, 2016 14:04
-
-
Save rowlandekemezie/f742f799d6edf02f313107b35f8cfac5 to your computer and use it in GitHub Desktop.
inject sagas into the store
This file contains hidden or 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
// Initialize the saga middleware | |
const sagaMiddleware = createSagaMiddleware(); | |
// Inject middleware to the store | |
const store = createStore(userReducer, applyMiddleware(sagaMiddleware)); | |
// Run the sagas you defined. | |
// You would normally have a rootSaga were you register all your saga | |
// Or spread then in the run function. | |
sagaMiddleware.run(watchRequest); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment