mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-25 19:13:56 +03:00
4164b6279e
* d3tooltip * map2tree * d3-state-visualizer * react-base16-styling * react-dock * Cleanup * Update * react-json-tree * redux-devtools * redux-devtools-app * redux-devtools-app-core * redux-devtools-cli * Fix * redux-devtools-dock-monitor * redux-devtools-extension * redux-devtools-inspector-monitor * redux-devtools-inspector-monitor-test-tab * redux-devtools-inspector-monitor-trace-tab * redux-devtools-instrument * Simplify * redux-devtools-log-monitor * redux-devtools-remote * redux-devtools-rtk-query-monitor * redux-devtools-serialize * redux-devtools-slider-monitor * redux-devtools-utils * Format |
||
---|---|---|
.. | ||
src | ||
babel.config.esm.json | ||
babel.config.json | ||
CHANGELOG.md | ||
eslint.config.mjs | ||
package.json | ||
README.md | ||
tsconfig.json |
Redux DevTools Extension's helper
Usage
Install:
yarn add @redux-devtools/extension
and use like that:
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:
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