0.9.1 • Published 4 years ago
@redux-tools/reducers v0.9.1
@redux-tools/reducers
A Redux store enhancer for asynchronous injection of reducers.
API Reference
makeEnhancer
Function which creates an enhancer to pass to createStore()
.
Arguments
This function accepts no arguments.
Returns
(Enhancer): A Redux store enhancer which you can pass to createStore()
.
Example
import { createStore } from 'redux';
import { makeEnhancer as makeReducersEnhancer } from '@redux-tools/reducers';
import { identity } from 'ramda';
const store = createStore(identity, makeReducersEnhancer());
store.injectReducers
This function will store passed reducers internally and replace the existing reducer with a fresh one.
Arguments
reducers
(Object): Reducers to inject.options
(Object): Injection options. The following keys are supported:namespace
(string): Namespace to inject the reducer under. If passed, the reducer will not handle actions from other namespaces and will store its state instate.namespaces[namespace]
instead of in the root.feature
(string): This string will be used instead of the defaultnamespaces
key to store the reducer state, allowing you to use @redux-tools for feature-based store structure (similar to Redux Form, e.g.state.form.contact.values
).
store.ejectReducers
Opposite to store.injectReducers
. This function will remove the injected reducers. Make sure that you pass the correct namespace and epics (keys AND values), otherwise the reducers will not be removed.
Arguments
reducers
(Object): Reducers to eject. Make sure that both the keys and values match the injected ones!options
(Object): Ejection options. The following keys are supported:
0.9.1
4 years ago
0.8.2
4 years ago
0.8.1
4 years ago
0.8.0
4 years ago
0.7.0
4 years ago
0.6.0
5 years ago
0.5.0
5 years ago
0.5.0-alpha.4
5 years ago
0.5.0-alpha.3
5 years ago
0.5.0-alpha.2
5 years ago
0.5.0-alpha.1
5 years ago
0.5.0-alpha.0
5 years ago
0.4.0
5 years ago
0.3.0
5 years ago
0.2.0
5 years ago
0.1.2
5 years ago
0.1.1
5 years ago