Skip to content

Instantly share code, notes, and snippets.

@BiosBoy
Created January 13, 2019 14:26
Show Gist options
  • Select an option

  • Save BiosBoy/fabc3609cedf6707dde0e287f54d9eac to your computer and use it in GitHub Desktop.

Select an option

Save BiosBoy/fabc3609cedf6707dde0e287f54d9eac to your computer and use it in GitHub Desktop.
// saga entry point - propbably you don't need this
import createSagaMiddleware from 'redux-saga';
import { all } from 'redux-saga/effects';
import createSagaMiddlewareHelpers from 'redux-saga-watch-actions/lib/middleware';
import watchSagas from '../../modules/saga';
const sagaMiddleware = createSagaMiddleware();
const runSaga = saga => sagaMiddleware.run(saga);
const { injectSaga, cancelTask } = createSagaMiddlewareHelpers(sagaMiddleware); // <-- bind to sagaMiddleware.run
export function* rootSaga() {
yield all([watchSagas()]);
}
export { cancelTask, injectSaga, runSaga };
export default sagaMiddleware;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment