mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-22 01:26:48 +03:00
8682d05b0b
* Update Redux packages * Fix instrument build * Fix some test type errors * Fix redux-devtools build * Fix rtk-query-monitor build * Fix redux-devtools-app build * Fix redux-devtools-extension build * Fix redux-devtools-remote build * Fix extension build * slider-monitor-example * test-tab-demo * inspector-monitor-demo * rtk-query-monitor-demo * counter-example * todomvc-example * Fix lint * Fix instrument test types * Fix core tests * Fix rtk-query-monitor tests * Updates |
||
---|---|---|
.. | ||
src | ||
.eslintignore | ||
.eslintrc.js | ||
babel.config.esm.json | ||
babel.config.json | ||
CHANGELOG.md | ||
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