Socket
Socket
Sign inDemoInstall

redux-action-enhancer-middleware

Package Overview
Dependencies
3
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    redux-action-enhancer-middleware

Middleware that provides an enhancing function to dispatched actions, with optional filtering to target only certain actions.


Version published
Maintainers
1
Install size
33.6 kB
Created

Readme

Source

redux-action-enhancer-middleware

Middleware that provides an enhancing function to dispatched actions, with optional filtering to target only certain actions.

Install

npm i -S redux-action-enhancer-middleware

Example

import actionEnhancerMiddleware from 'redux-action-enhancer-middleware';

const options = {
  filter: (action) => true,
  enhancer: (dispatch, getState, action) => {...action}
};

const store = createStore(
  reducer,
  applyMiddleware(
    actionEnhancerMiddleware(options)
  )
);

API

redux-action-enhancer-middleware takes an options object with an optional filter and a required enhancer.

Filter
(action) => true

Function that receive an action and returns a boolean that determines if the enhancer should be invoked.

Enhancer
(dispatch, getState, action) => nextAction

Function that receives a dispatch, getState, and action. The enhancer returns an action.

Keywords

FAQs

Last updated on 19 Oct 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc