Skip to content

Commit 931abd0

Browse files
committed
Update README.md
1 parent 546116f commit 931abd0

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,32 @@ export default createDevTools(
2323
);
2424
```
2525

26+
You can inject action creators to ease the process of testing your app firing yourself actions.
27+
28+
```js
29+
import React from 'react';
30+
import { createDevTools } from 'redux-devtools';
31+
import Dispatcher from 'redux-devtools-dispatch';
32+
33+
const actionCreators = {
34+
increment() {
35+
return {type: 'INCREMENT_COUNTER'};
36+
},
37+
decrement() {
38+
return {type: 'DECREMENT_COUNTER'};
39+
},
40+
nested: {
41+
worksToo() {
42+
return {type: 'NESTED_WORKS_TOO', cool: true};
43+
},
44+
},
45+
};
46+
47+
export default createDevTools(
48+
<Dispatcher actionCreators={actionCreators} />
49+
);
50+
```
51+
2652
You can also use `<MultipleMonitors>`, a hacky class to use multiple monitors into the `<DockMonitor>`:
2753

2854
```js
@@ -52,6 +78,7 @@ Name | Description
5278
------------- | -------------
5379
`theme` | _Same as in LogMonitor's package_ Either a string referring to one of the themes provided by [redux-devtools-themes](https://github.com/gaearon/redux-devtools-themes) (feel free to contribute!) or a custom object of the same format. Optional. By default, set to [`'nicinabox'`](https://github.com/gaearon/redux-devtools-themes/blob/master/src/nicinabox.js).
5480
`initEmpty` | When `true`, the dispatcher is empty. By default, set to `false`, the dispatcher contains : `{ "type": "" }`.
81+
`actionCreators` | Either a array of action creators or an object containing action creators. When defined, a selector appears to choose the action creator you want to fire, you can fill up the arguments and dispatch the action.
5582

5683
### Contributing
5784

0 commit comments

Comments
 (0)