Skip to content

Commit f8a6edc

Browse files
committed
Add information about keeping other store enhancers the last in the compose
Related to #261
1 parent 39cf733 commit f8a6edc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/Troubleshooting.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,17 @@ If you develop on your local filesystem, make sure to allow Redux DevTools acces
1515
### It shows only the `@@INIT` action or moving back and forth doesn't update the state
1616

1717
Most likely you mutate the state. Check it by [adding `redux-immutable-state-invariant` middleware](https://github.com/zalmoxisus/redux-devtools-extension/blob/master/examples/counter/store/configureStore.js#L3).
18+
19+
### It doesn't work with other store enhancers
20+
21+
Usually the extension's store enhancer should be last in the compose. When you're using `window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__` or `composeWithDevTools` helper you don't have to worry about the enhancers order. However some enhancers ([like `redux-batched-subscribe`](https://github.com/zalmoxisus/redux-devtools-extension/issues/261)) also have this requirement to be the last in the compose. In this case you can use it like so:
22+
23+
```js
24+
const store = createStore(reducer, preloadedState, compose(
25+
// applyMiddleware(thunk),
26+
window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : noop => noop,
27+
batchedSubscribe(/* ... */)
28+
));
29+
```
30+
31+
Where `batchedSubscribe` is `redux-batched-subscribe` store enhancer.

0 commit comments

Comments
 (0)