Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 1.46 KB

File metadata and controls

27 lines (18 loc) · 1.46 KB

@redux-dynostore/react-redux-subspace

build status npm version npm downloads License: BSD-3-Clause

Enhancer for mounting React components within subspaces when using redux-dynostore.

Usage

import dynamic from '@redux-dynostore/react-redux'
import subspaced from '@redux-dynostore/react-redux-subspace'

export default dynamic('identifier', subspaced())(MyComponent)

With extra state

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.