@pagoru/redux-middleware
TypeScript icon, indicating that this package has built-in type declarations

20.97.1 • Public • Published

Build status

@pagoru/redux-middleware

Simple redux middleware library, to create your own middleware.

Usage

import { createStore } from 'redux'
import { middleware, middlewareHandler } from 'redux-middleware'

// Create as many you need.
middlewareHandler(  
    (action, getState) => {  
	    // you can modify your action here
		console.log('will', action, getState());  
		return action;  
  }, (action, getState) => {  
        console.log('did', action, getState());  
  }  
);

const initialStore = {}
// Add the middleware to the createStore.
const store = createStore(rootReducer, initialStore, applyMiddleware(middleware));

Package Sidebar

Install

npm i @pagoru/redux-middleware

Weekly Downloads

4

Version

20.97.1

License

MIT

Unpacked Size

3.63 kB

Total Files

5

Last publish

Collaborators

  • pagoru