|
1 | | -# redux-devtools-dispatch |
| 1 | +# Redux DevTools Dispatch |
2 | 2 | Dispatch your actions manually to test if your app react well. |
| 3 | + |
| 4 | +### Installation |
| 5 | + |
| 6 | +`npm install --save-dev redux-devtools-dispatch` |
| 7 | + |
| 8 | +### Usage |
| 9 | + |
| 10 | +You can declare your Dispatcher the same way you declare a Monitor in your Dev Tools. |
| 11 | + |
| 12 | +```js |
| 13 | +import React from 'react'; |
| 14 | +import { createDevTools } from 'redux-devtools'; |
| 15 | +import Dispatcher from 'redux-devtools-dispatch'; |
| 16 | + |
| 17 | +export default createDevTools( |
| 18 | + <Dispatcher /> |
| 19 | +); |
| 20 | +``` |
| 21 | + |
| 22 | +You can also use `<MultipleMonitors>`, a hacky class to use multiple monitors into the `<DockMonitor>`: |
| 23 | + |
| 24 | +```js |
| 25 | +import React from 'react'; |
| 26 | + |
| 27 | +import { createDevTools } from 'redux-devtools'; |
| 28 | +import LogMonitor from 'redux-devtools-log-monitor'; |
| 29 | +import DockMonitor from 'redux-devtools-dock-monitor'; |
| 30 | +import Dispatcher from 'redux-devtools-dispatch'; |
| 31 | +import MultipleMonitors from 'redux-devtools-dispatch/lib/MultipleMonitors'; |
| 32 | + |
| 33 | +export default createDevTools( |
| 34 | + <DockMonitor toggleVisibilityKey="ctrl-h" changePositionKey="ctrl-q" defaultIsVisible={false}> |
| 35 | + <MultipleMonitors> |
| 36 | + <LogMonitor /> |
| 37 | + <Dispatcher /> |
| 38 | + </MultipleMonitors> |
| 39 | + </DockMonitor> |
| 40 | +); |
| 41 | +``` |
| 42 | + |
| 43 | +Then, just write an JSON action in the field, click on Dispatch, and that's all! |
| 44 | + |
| 45 | +### Props |
| 46 | + |
| 47 | +Name | Description |
| 48 | +------------- | ------------- |
| 49 | +`initEmpty` | When `true`, the dispatcher is empty. By default, set to `false`, the dispatcher contains : `{ "type": "" }`. |
| 50 | + |
| 51 | +### Contributing |
| 52 | + |
| 53 | +As this package is my first, any comment, pull request, issue is welcome so I can learn more from everyone. |
| 54 | + |
| 55 | +### License |
| 56 | + |
| 57 | +MIT |
0 commit comments