MCPcopy Index your code
hub / github.com/YoruNoHikage/redux-devtools-dispatch

github.com/YoruNoHikage/redux-devtools-dispatch @v2.2.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.2.1 ↗ · + Follow
35 symbols 71 edges 19 files 0 documented · 0% updated 9y agov2.2.1 · 2017-05-16★ 1402 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Redux DevTools Dispatch

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.

import React from 'react';
import { createDevTools } from 'redux-devtools';
import Dispatcher from 'redux-devtools-dispatch';

export default createDevTools(
  <Dispatcher />
);

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

import React from 'react';
import { createDevTools } from 'redux-devtools';
import Dispatcher from 'redux-devtools-dispatch';

const actionCreators = {
  increment() {
    return {type: 'INCREMENT_COUNTER'};
  },
  decrement() {
    return {type: 'DECREMENT_COUNTER'};
  },
  nested: {
    worksToo() {
      return {type: 'NESTED_WORKS_TOO', cool: true};
    },
  },
};

export default createDevTools(
  <Dispatcher actionCreators={actionCreators} />
);

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

import React from 'react';

import { createDevTools } from 'redux-devtools';
import LogMonitor from 'redux-devtools-log-monitor';
import DockMonitor from 'redux-devtools-dock-monitor';
import Dispatcher from 'redux-devtools-dispatch';
import MultipleMonitors from 'redux-devtools-multiple-monitors';

export default createDevTools(
  <DockMonitor toggleVisibilityKey="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

Name Description
theme Same as in LogMonitor's package Either a string referring to one of the themes provided by redux-devtools-themes (feel free to contribute!) or a custom object of the same format. Optional. By default, set to 'nicinabox'.
initEmpty When true, the dispatcher is empty. By default, set to false, the dispatcher contains : { "type": "" }.
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.
dispatchFn Function to be called for dispatching actions. By default it is using component's this.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

Core symbols most depended-on inside this repo

increment
called by 3
examples/counter/src/actions/CounterActions.js
actionCreator
called by 1
src/Dispatcher.js
interpretArg
called by 1
src/Dispatcher.js
flatTree
called by 1
src/Dispatcher.js
decrement
called by 1
examples/counter/src/actions/CounterActions.js
configureStore
called by 1
examples/counter/src/store/configureStore.dev.js
constructor
called by 0
src/Dispatcher.js
selectActionCreator
called by 0
src/Dispatcher.js

Shape

Function 22
Class 9
Method 4

Languages

TypeScript100%

Modules by API surface

src/Dispatcher.js14 symbols
examples/counter/src/actions/CounterActions.js5 symbols
examples/counter/src/containers/CounterApp.js4 symbols
examples/counter/src/containers/Root.prod.js3 symbols
examples/counter/src/containers/Root.dev.js3 symbols
examples/counter/src/components/Counter.js3 symbols
examples/counter/src/store/configureStore.prod.js1 symbols
examples/counter/src/store/configureStore.dev.js1 symbols
examples/counter/src/reducers/counter.js1 symbols

For agents

$ claude mcp add redux-devtools-dispatch \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact