Open hwzhang92 opened 4 years ago
Are you using <StrictMode>
any where in your React application?
@abettadapur I've faced the same issue.
Saga with spawn
does it.
function* rootSaga() {
yield all([fork(someSaga1), spawn(someSaga2)])
}
also example from saga documentations
function* rootSaga () {
const sagas = [
saga1,
saga2,
saga3,
];
yield all(sagas.map(saga =>
spawn(function* () {
while (true) {
try {
yield call(saga)
break
} catch (e) {
console.log(e)
}
}
}))
);
}
Any ideas on how to solve it? I don't think there is any.
spawn
creates a saga at the root level, so it is not something we can cancel
If you use spawn, make sure to save a reference to the task so you can manually cancel it
when use redux-dynamic-modules-saga, it dont remove saga when use DynamicModuleLoader or remove handle returned by store.addModules. When it add module again, the saga will also be two.