https://github.com/pagoru/redux-middleware
https://github.com/pagoru/redux-middleware
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pagoru/redux-middleware
- Owner: pagoru
- License: mit
- Created: 2020-03-22T16:41:35.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-03-26T08:56:51.000Z (over 4 years ago)
- Last Synced: 2025-02-07T01:34:48.634Z (over 1 year ago)
- Language: TypeScript
- Size: 73.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# @pagoru/redux-middleware
Simple redux middleware library, to create your own middleware.
## Usage
```js
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));
```