How to use the redux-dynamic-modules-core.getMap function in redux-dynamic-modules-core

To help you get started, we’ve selected a few redux-dynamic-modules-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / redux-dynamic-modules / packages / redux-dynamic-modules-saga / src / SagaManager.ts View on Github external
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;

redux-dynamic-modules-core

Modularize the redux app by dynamically loading reducers, state and sagas

MIT
Latest version published 4 years ago

Package Health Score

56 / 100
Full package analysis