Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function getSagaManager(
sagaMiddleware: SagaMiddleware
): IItemManager> {
const tasks = getMap, Task>(sagaEquals);
return {
getItems: (): ISagaRegistration[] => [...tasks.keys],
add: (sagas: ISagaRegistration[]) => {
if (!sagas) {
return;
}
sagas.forEach(saga => {
if (saga && !tasks.get(saga)) {
tasks.add(saga, runSaga(sagaMiddleware, saga));
}
});
},
remove: (sagas: ISagaRegistration[]) => {
if (!sagas) {
return;