npm.io
0.0.1 • Published 7 years ago

redux-bomb

Licence
MIT
Version
0.0.1
Deps
0
Size
3 kB
Vulns
0
Weekly
0
Stars
1

Redux Bomb

This is a useless middleware.

This middleware will fork 2 more actions when every dispatching.

Get Started

import { createStore, applyMiddleware } from 'redux';
import bomb from '../src';

const counter = (state = 0, action) => {
  if (action.type === 'INCREMENT') return state + 1;

  return state;
};

const store = createStore(counter, applyMiddleware(bomb));

store.subscribe(() => console.log(store.getState()));

store.dispatch({ type: 'INCREMENT' });

/*
  A beautiful flushing screen
*/

Demo

with-delay

It can set delay in milesecond.

  applyMiddleware(bomb.delay(1000));

That it.

DO NOT USE IT.

Keywords