0.2.0 • Published 7 years ago

redux-reducer-dispatcher v0.2.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 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

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago