Enhancer for mounting React components within subspaces when using redux-dynostore.
import dynamic from '@redux-dynostore/react-redux'
import subspaced from '@redux-dynostore/react-redux-subspace'
export default dynamic('identifier', subspaced())(MyComponent)
export default dynamic('identifier', subspaced({ mapExtraState: (state, rootState) => ({ /* ... */ }) }))(MyComponent)
When mounted, MyComponent
will be wrapped in a SubspaceProvider
.
If you are attaching a reducer dynamically, you should use the redux-subspace variant to ensure it will receive the namespaced actions.