@redux-tools/reducers-react v0.9.1
@redux-tools/reducers-react
React bindings for the @redux-tools/reducers package.
API Reference
withReducers
Creates a component decorator which handles the lifecycle of passed reducers, mounting and unmounting them automatically. The namespace of the reducers is determined based on React context.
Arguments
reducers
(Object): The reducers to use.options
(Object): Options for the decorator. Possible options:isGlobal: boolean
,isPersistent: boolean
,feature: string
, andnamespace: string
.
Returns
(Function): A component decorator.
Example
import React from 'react';
import { withReducers } from '@redux-tools/reducers-react';
import countReducer from './duck';
const Container = () => null;
export default withReducers({ count: countReducer })(Container);
namespacedConnect
Works just like connect()
from react-redux, except it accesses namespaced state based on React context and automatically adds the correct namespace to dispatched actions.
Passes global state as the third argument to mapStateToProps
.
See react-redux docs for more info.
<Provider />
See injectors-react for more info.
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago