New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fluxible-plugin-middleware

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fluxible-plugin-middleware

A plugin for Fluxible applications to provide an interface that attaches middlewares between an action dispatch and a store handler

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Middleware Plugin for Fluxible

A plugin for Fluxible applications to provide an interface that attaches middlewares between an action dispatch and a store handler. Highly inspired by Redux middlewares.

Install

npm install fluxible-plugin-middleware

Usage

import middlewarePlugin from "fluxible-plugin-middleware";
import Fluxible from "fluxible";

const app = new Fluxible();

const logMiddleware = function(actionContext){
    return function(next) {
      return function(type, payload){
        console.log(actionContext);
        console.info(type, payload);
        next(type, payload);
      };
    };
};

app.plug(middlewarePlugin(logMiddleware));

Now, when calling the context.dispatch method within action creators, all action objects will pass through the middlewares before getting dispatched into the stores for handling.

Your middlewares will also have access to the entire actionContext so you can fire the context functions within your middlewares if you like.

For additional middlewares:

app.plug(middlewarePlugin(logMiddleware, secondMiddleware, thirdMiddleware));

Keywords

FAQs

Package last updated on 02 Oct 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc