Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Dispatch your actions manually to test if your app reacts well.

License

NotificationsYou must be signed in to change notification settings

YoruNoHikage/redux-devtools-dispatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dispatch your actions manually to test if your app reacts well.

npm version

redux-devtools-dispatch

Installation

npm install --save-dev redux-devtools-dispatch

Usage

You can declare your Dispatcher the same way you declare a Monitor in your Dev Tools.

importReactfrom'react';import{createDevTools}from'redux-devtools';importDispatcherfrom'redux-devtools-dispatch';exportdefaultcreateDevTools(<Dispatcher/>);

You can inject action creators to ease the process of testing your app firing yourself actions.

importReactfrom'react';import{createDevTools}from'redux-devtools';importDispatcherfrom'redux-devtools-dispatch';constactionCreators={increment(){return{type:'INCREMENT_COUNTER'};},decrement(){return{type:'DECREMENT_COUNTER'};},nested:{worksToo(){return{type:'NESTED_WORKS_TOO',cool:true};},},};exportdefaultcreateDevTools(<DispatcheractionCreators={actionCreators}/>);

You can also use<MultipleMonitors> fromredux-devtools-multiple-monitors to use multiple monitors into the<DockMonitor>:

importReactfrom'react';import{createDevTools}from'redux-devtools';importLogMonitorfrom'redux-devtools-log-monitor';importDockMonitorfrom'redux-devtools-dock-monitor';importDispatcherfrom'redux-devtools-dispatch';importMultipleMonitorsfrom'redux-devtools-multiple-monitors';exportdefaultcreateDevTools(<DockMonitortoggleVisibilityKey="ctrl-h"changePositionKey="ctrl-q"defaultIsVisible={false}><MultipleMonitors><LogMonitor/><Dispatcher/></MultipleMonitors></DockMonitor>);

Then, just write an JSON action in the field, click on Dispatch, and that's all!

Props

NameDescription
themeSame as in LogMonitor's package Either a string referring to one of the themes provided byredux-devtools-themes (feel free to contribute!) or a custom object of the same format. Optional. By default, set to'nicinabox'.
initEmptyWhentrue, the dispatcher is empty. By default, set tofalse, the dispatcher contains :{ "type": "" }.
actionCreatorsEither 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.
dispatchFnFunction to be called for dispatching actions. By default it is using component'sthis.context.store.dispatch.

Contributing

As this package is my first, any comment, pull request, issue is welcome so I can learn more from everyone.

License

MIT

About

Dispatch your actions manually to test if your app reacts well.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors4

  •  
  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp