0.9.1 • Published 4 years ago
@redux-tools/injectors-react v0.9.1
@redux-tools/injectors-react
Internal reusable logic for React injectors.
API Reference
<Provider />
The same component is exported from @redux-tools/reducers-react
, @redux-tools/epics-react
and @redux-tools/middleware-react
as well.
The <Provider />
React component makes the injection mechanism accessible to nested components. There are essentially three approaches to using this component:
- You do not need to handle namespacing at all.
- Just use react-redux's
<Provider />
. You don't need to use the @redux-tools<Provider />
at all.
- Just use react-redux's
- You are able to access the current namespace using React context from anywhere inside a widget and you are using a single virtual DOM for all widgets.
- You can wrap the entire application in a single
<Provider useNamespace={useNamespace}>
component and you are done!
- You can wrap the entire application in a single
- You are not using a single virtual DOM or you cannot reliably access the namespace from a nested component.
- You should resort to wrapping each widget separately by using
<Provider namespace={namespace}>
instead.
- You should resort to wrapping each widget separately by using
This component is also a drop-in replacement for react-redux's <Provider />
.
Props
store
: The Redux store.useNamespace
(Function): A function or a hook which returns the correct namespace (probably by using React context).namespace
(string): A namespace to use for all nested components. Has priority overuseNamespace
.feature
(string): Feature to set the namespace for. Allows arbitrary nesting.
0.9.1
4 years ago
0.8.1
4 years ago
0.8.2
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