0.2.0 • Published 6 years ago

redux-reducer-dispatcher v0.2.0

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

redux-reducer-dispatcher

This is a small module to help dispatch an action in a reducer asynchronously.

Installation

npm install redux-reducer-dispatcher

Usage

import { applyMiddleware, createStore } from 'redux';

import reducerDispatcherMiddleware from "redux-reducer-dispatcher";

const store = createStore(
  reducer,
  applyMiddleware(reducerDispatcherMiddleware)
)

// Note passing middleware as the third argument requires redux@>=3.1.0
//Reducer Function

export default function(state: any = initialState, action: Function) {
  switch (action.type) {
    case "XYZ":
      action.reducerDispatch({ type: "newActionType" });
      return {
        ...state
        //XYZ: ZYX,
      };
  }
}
0.2.0

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago