UNPKG

1.53 kBMarkdownView Raw
1# Redux DevTools Extension's helper
2
3[![Join the chat at https://gitter.im/zalmoxisus/redux-devtools-extension](https://badges.gitter.im/zalmoxisus/redux-devtools-extension.svg)](https://gitter.im/zalmoxisus/redux-devtools-extension?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4
5## Usage
6
7Install:
8
9```
10npm install --save redux-devtools-extension
11```
12
13and use like that:
14
15```js
16import { createStore, applyMiddleware } from 'redux';
17import { composeWithDevTools } from 'redux-devtools-extension';
18
19const store = createStore(
20 reducer,
21 composeWithDevTools(
22 applyMiddleware(...middleware)
23 // other store enhancers if any
24 )
25);
26```
27
28or if needed to apply [extension’s options](https://github.com/zalmoxisus/redux-devtools-extension/blob/master/docs/API/Arguments.md#windowdevtoolsextensionconfig):
29
30```js
31import { createStore, applyMiddleware } from 'redux';
32import { composeWithDevTools } from 'redux-devtools-extension';
33
34const composeEnhancers = composeWithDevTools({
35 // Specify here name, actionsBlacklist, actionsCreators and other options
36});
37const store = createStore(
38 reducer,
39 composeEnhancers(
40 applyMiddleware(...middleware)
41 // other store enhancers if any
42 )
43);
44```
45
46There’re just [few lines of code](https://github.com/zalmoxisus/redux-devtools-extension/blob/master/npm-package/index.js). If you don’t want to allow the extension in production, just use ‘redux-devtools-extension/developmentOnly’ instead of ‘redux-devtools-extension’.
47
48## License
49
50MIT