0.9.1 • Published 4 years ago

@redux-tools/reducers-react v0.9.1

Weekly downloads
200
License
MIT
Repository
github
Last release
4 years ago

@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

  1. reducers (Object): The reducers to use.
  2. options (Object): Options for the decorator. Possible options: isGlobal: boolean, isPersistent: boolean, feature: string, and namespace: 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.

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.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago