mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-25 02:53:53 +03:00
922985f9ea
* chore(deps): update dependency prettier to v3 * Format --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Nathan Bierema <nbierema@gmail.com>
1.5 KiB
1.5 KiB
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