I think there's something wrong with async sagas injection
Say we have the following route:
getComponent(nextState, cb) {
const importModules = Promise.all([
System.import('containers/HomePage/reducer'),
System.import('containers/HomePage/sagas'),
System.import('containers/HomePage'),
]);
const renderRoute = loadModule(cb);
importModules.then(([reducer, sagas, component]) => {
injectReducer('home', reducer.default);
injectSagas(sagas.default);
renderRoute(component);
});
importModules.catch(errorLoading);
}
The problem is every time home route got hit home sagas would be injected and run again and we end up have duplicated sagas running in background .
I don't know if it's the expected behavior !
That's what this is for in the saga:
yield take(LOCATION_CHANGE);
yield cancel(watcher);
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
That's what this is for in the saga: