How to use redux-dynamic-modules - 3 common examples

To help you get started, we’ve selected a few redux-dynamic-modules 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 / SagaExtension.ts View on Github external
//@ts-ignore
    if (process.env.NODE_ENV === "development" && typeof window !== "undefined") {
        sagaMonitor = window["__SAGA_MONITOR_EXTENSION__"] || undefined;
    }

    // Setup the saga middleware
    let sagaMiddleware: SagaMiddleware = createSagaMiddleware({
        context: sagaContext,
        sagaMonitor,
        onError,
    });

    let _sagaManager: IItemManager<
        ISagaRegistration
    > = getRefCountedManager(getSagaManager(sagaMiddleware), sagaEquals);

    return {
        middleware: [sagaMiddleware],

        onModuleManagerCreated: (moduleManager: IModuleManager) => {
            if (sagaContext) {
                sagaContext["moduleManager"] = moduleManager;
            }
        },

        onModuleAdded: (module: ISagaModule): void => {
            if (module.sagas) {
                _sagaManager.add(module.sagas);
            }
        },
github microsoft / redux-dynamic-modules / packages / todo-example / src / index.js View on Github external
import React from "react";
import { render } from "react-dom";
import { createStore } from "redux-dynamic-modules";
import { Provider } from "react-redux";
import App from "./components/App";

const store = createStore({});

render(
    
        
    ,
    document.getElementById("root")
);
github microsoft / redux-dynamic-modules / packages / typescript-example / src / App.tsx View on Github external
constructor(props: any, context: any) {
        super(props, context);
        this.store = createStore({ extensions: [getSagaExtension()] });
    }
    render() {

redux-dynamic-modules

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

MIT
Latest version published 5 years ago

Package Health Score

59 / 100
Full package analysis