Back to Redux Devtools

Redux DevTools Extension's helper

packages/redux-devtools-extension/README.md

3.6.01.5 KB
Original Source

Redux DevTools Extension's helper

Usage

Install:

yarn add @redux-devtools/extension

and use like that:

js
import { createStore, applyMiddleware } from 'redux';
import { composeWithDevTools } from '@redux-devtools/extension';

const store = createStore(
  reducer,
  composeWithDevTools(
    applyMiddleware(...middleware),
    // other store enhancers if any
  ),
);

or if needed to apply extension’s options:

js
import { createStore, applyMiddleware } from 'redux';
import { composeWithDevTools } from '@redux-devtools/extension';

const composeEnhancers = composeWithDevTools({
  // Specify here name, actionsDenylist, actionsCreators and other options
});
const store = createStore(
  reducer,
  composeEnhancers(
    applyMiddleware(...middleware),
    // other store enhancers if any
  ),
);

There are just a few lines of code. If you don’t want to allow the extension in production, just use composeWithDevToolsDevelopmentOnly instead of composeWithDevTools.

License

MIT