Skip to content
This repository was archived by the owner on Jan 27, 2021. It is now read-only.

Commit 9fb4df9

Browse files
committed
Added docs for providing additional subspace options
1 parent f65a7bb commit 9fb4df9

File tree

1 file changed

+13
-1
lines changed
  • packages/redux-dynostore-react-redux-subspace

1 file changed

+13
-1
lines changed

packages/redux-dynostore-react-redux-subspace/README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ When mounted, `MyComponent` will be wrapped in a [`SubspaceProvider`](https://io
4949

5050
If you are attaching a reducer dynamically, you should use the [redux-subspace variant](/packages/redux-dynostore-redux-subspace) to ensure it will receive the namespaced actions.
5151

52-
##### `stateHandler`
52+
### `stateHandler`
5353

5454
```javascript
5555
const store = createStore(reducer, dynostore(dynamicReducers(), { stateHandler: customStateHandler }))
@@ -72,3 +72,15 @@ State handlers are provided as an object with the following functions:
7272
_Note, this is a subset of [the `stateHandler` option of `dynamicReducers`](/packages/redux-dynostore-core#stateHandler)._
7373

7474
By default, `subspaced` will use the `defaultStateHandler` exported from the core package.
75+
76+
### Additional Subspace Options
77+
78+
Any additional options provided to `subspaced` will be passed through as the [options argument to the underlying `react-redux-subspace` library](https://ioof-holdings.github.io/redux-subspace/packages/react-redux-subspace/docs/api/subspaced.html#arguments). This is most commonly used to provide a custom context to locate the Redux store to use:
79+
80+
```javascript
81+
const CustomContext = React.createContext
82+
83+
// ...
84+
85+
export default dynamic('identifier', subspaced({ context: CustomContext }))(MyComponent)
86+
```

0 commit comments

Comments
 (0)