Skip to main content

Redux DevTools

It is possible to debug store changes using the Redux DevTools. It can be used as a browser extension (for Chrome, Edge and Firefox), as a standalone app or as a React component integrated in the client app.

Enable DevTools​

We have a middleware to enable Redux DevTools on your store. Your store should be wrapped with withDevTools, otherwise the it will not work as expected. Here Counter Store is a store identifier for the Redux DevTools.

import { createStore, withDevTools } from '@poly-state/poly-state';
import { useStore } from '@poly-state/react';

const counterStore = createStore({ count: 0 });
withDevTools(counterStore, 'Counter Store');

const useCounterStore = () => useStore(counterStore);

Conditionally Enable​

import { createStore, withDevTools } from '@poly-state/poly-state';
import { useStore } from '@poly-state/react';

const counterStore = createStore({ count: 0 });
if (process.env.NODE_ENV === 'development') {
withDevTools(counterStore, 'Counter Store');
}

const useCounterStore = () => useStore(counterStore);

Install Redux DevTools​

1. For Chrome​

2. For Firefox​

3. For Electron​

4. For other browsers and non-browser environment​

For more information, see Redux DevTools documentation.