redux-id-modules

1.0.1 • Public • Published

redux-id-modules

Groups your Redux reducers and routes into modules so you can easily compose them.

Build Status

Installation

npm install --save redux-id-modules

Usage

See the Example.

API

Module definition

Define a module as an object with these properties:

module.exports = {
  // Name of the module
  name: 'MyModule',

  // Reducers object that this module exports.
  reducers: require('./reducers'),

  // Routes function that this module exports.
  routes: require('./routes'),

  // List of submodules
  modules: [ require('./modules/MyOtherModule') ],
}

getReducers(module)

Returns a reducer function for the module and all it's submodules or null

getRoutes(module, store)

Returns a React Element that is a composition of the routes of the module and of all it's submodules

Readme

Keywords

Package Sidebar

Install

npm i redux-id-modules

Weekly Downloads

1

Version

1.0.1

License

Unlicense

Last publish

Collaborators

  • industrial