JSPM

  • Created
  • Published
  • Downloads 11673
  • Score
    100M100P100Q138952F
  • License MIT

Saga Extension for redux-dynamic-modules

Package Exports

  • redux-dynamic-modules-saga

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (redux-dynamic-modules-saga) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Install

Run

npm install redux-dynamic-modules-saga

or

yarn add redux-dynamic-modules-saga

Usage

  • Create a module with the following format
export function getUsersModule(): ISagaModule<IUserState> {
    return {
        id: "users",
        reducerMap: {
            users: usersReducer,
        },
        sagas: [userSagas],
        // Actions to fire when this module is added/removed
        // initialActions: [],
        // finalActions: [],
    };
}
  • Create a ModuleStore
import { createStore, IModuleStore } from "redux-dynamic-modules";
import { getSagaExtension } from "redux-dynamic-modules-saga";
import { getUsersModule } from "./usersModule";

const store: IModuleStore<IState> = createStore(
  {
    initialState: {},
    enhancers: [],
    extensions: [getSagaExtension({} /* saga context */)],
  },
  getUsersModule()
  /* ...any additional modules */
);