Skip to content

Instantly share code, notes, and snippets.

@rowlandekemezie
Last active November 25, 2016 14:04
Show Gist options
  • Save rowlandekemezie/f742f799d6edf02f313107b35f8cfac5 to your computer and use it in GitHub Desktop.
Save rowlandekemezie/f742f799d6edf02f313107b35f8cfac5 to your computer and use it in GitHub Desktop.
inject sagas into the store
// 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