npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

id-redux-modules

v2.2.0

Published

Create Redux app modules and compose them

Downloads

8

Readme

id-redux-modules

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

Build Status

Installation

npm install --save id-redux-modules

Usage

const Module = require('id-redux-modules').Module

const myModule = new Module({
  name: "MyModule",
  store: myStore,
})

Module

Represents a composable collection of redux parts.

Kind: global class

new Module(options)

Represents a composable collection of redux parts.

| Param | Type | Description | | --- | --- | --- | | options | Object | The options object. | | options.name | String | The name of the module. | | options.store | Object | The Redux store instance. | | options.actions | Object | The Redux actions the module can dispatch. | | options.actionCreators | Object | The action creators for the actions. | | options.components | Object | The components the module uses. | | options.routes | function | The final route component returned from the module. | | options.reducers | Object | The reducers of the module. They process the module's actions. | | options.submodules | Object | An array of submodules. |

module.name ⇒ String

Returns the name of the module.

Kind: instance property of Module Returns: String - name - The name of the module

module.name ⇒ Undefined

Sets the name of the module.

Kind: instance property of Module

| Param | Type | Description | | --- | --- | --- | | name | String | The name of the module. |

module.store ⇒ String

Returns the store of the module.

Kind: instance property of Module Returns: String - store - The store of the module

module.store ⇒ Undefined

Sets the store of the module and all it's submodules.

Kind: instance property of Module

| Param | Type | Description | | --- | --- | --- | | store | Object | The store. |

module.actions ⇒ Object

Returns the actions of the module.

Kind: instance property of Module Returns: Object - actions

module.actions ⇒ undefined

Replaces the actions.

Kind: instance property of Module

| Param | Type | Description | | --- | --- | --- | | actions | Object | The new actions. |

module.actionCreators ⇒ Object

Returns the actionCreators of the module.

Kind: instance property of Module Returns: Object - actionCreators

module.actionCreators ⇒ Undefined

Replaces the actionCreators.

Kind: instance property of Module

| Param | Type | Description | | --- | --- | --- | | actionCreators | Object | The new actionCreators. |

module.components ⇒ Object

Returns the components of the module.

Kind: instance property of Module Returns: Object - components

module.components ⇒ Undefined

Replaces the components.

Kind: instance property of Module

| Param | Type | Description | | --- | --- | --- | | components | Object | The new components. |

module.routes ⇒ Object

Calls the modules' routes function and composes it with the routes of the submodules, creating one route tree.

Kind: instance property of Module Returns: Object - Routes

module.routes ⇒ Undefined

Replaces the routes.

Kind: instance property of Module

| Param | Type | Description | | --- | --- | --- | | routes | function | The routes function. Returns a React Element. |

module.reducers ⇒ Object

Returns the reducers of the module combined with the reducers of the submodules.

Kind: instance property of Module Returns: Object - actions

module.reducers ⇒ Undefined

Replaces the reducers.

Kind: instance property of Module

| Param | Type | Description | | --- | --- | --- | | reducers | Object | The new reducers. |

module.submodules ⇒ Array

Returns the submodules of the module.

Kind: instance property of Module Returns: Array - submodules

module.submodules ⇒ Undefined

Replaces the submodules.

Kind: instance property of Module

| Param | Type | Description | | --- | --- | --- | | submodules | Array | The new submodules. |

module.addAction(name) ⇒ undefined

Adds an action to the module.

Kind: instance method of Module

| Param | Type | Description | | --- | --- | --- | | name | String | The name of the action. |

module.removeAction(name) ⇒ undefined

Removes an action from the module.

Kind: instance method of Module

| Param | Type | Description | | --- | --- | --- | | name | String | The name of the action. |

module.addActionCreator(name, actionCreator) ⇒ undefined

Adds an actionCreator to the module.

Kind: instance method of Module

| Param | Type | Description | | --- | --- | --- | | name | String | The name of the actionCreator. | | actionCreator | function | The actionCreator function. |

module.removeActionCreator(name) ⇒ Undefined

Removes an actionCreator from the module.

Kind: instance method of Module

| Param | Type | Description | | --- | --- | --- | | name | String | The name of the actionCreator. |

module.addReducer(name, reducer) ⇒ Undefined

Adds a reducer to the module.

Kind: instance method of Module

| Param | Type | Description | | --- | --- | --- | | name | String | The name of the reducer. | | reducer | function | The reducer function. |

module.removeReducer(name) ⇒ Undefined

Removes a reducer from the module.

Kind: instance method of Module

| Param | Type | Description | | --- | --- | --- | | name | String | The name of the reducer. |

module.addSubmodule(options) ⇒ Undefined

Adds a submodule to the module.

Kind: instance method of Module

| Param | Type | Description | | --- | --- | --- | | options | Object | The options for the submodule. |

module.removeSubmodule(submodule) ⇒ Undefined

Removes a submodule from the module.

Kind: instance method of Module

| Param | Type | Description | | --- | --- | --- | | submodule | Object | The options for the submodule. |