<commit_before># Middleware Plugin for Fluxible

A plugin for [Fluxible](https://github.com/yahoo/fluxible) applications to provide an interface that attaches middlewares between an action dispatch and a store handler. Highly inspired by [Redux middlewares](https://rackt.github.io/redux/docs/advanced/Middleware.html).

## Usage

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

const app = new Fluxible();

const logMiddleware = function(){
    return function(next) {
      return function(type, payload){
        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

For additional middlewares:

```js
app.plug(middlewarePlugin(logMiddleware, secondMiddleware, thirdMiddleware));
```<commit_msg>document installation<commit_after># Middleware Plugin for Fluxible

A plugin for [Fluxible](https://github.com/yahoo/fluxible) applications to provide an interface that attaches middlewares between an action dispatch and a store handler. Highly inspired by [Redux middlewares](https://rackt.github.io/redux/docs/advanced/Middleware.html).

## Install

```
npm install fluxible-plugin-middleware
```

## Usage

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

const app = new Fluxible();

const logMiddleware = function(){
    return function(next) {
      return function(type, payload){
        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

For additional middlewares:

```js
app.plug(middlewarePlugin(logMiddleware, secondMiddleware, thirdMiddleware));
```
{'fraction_non_alphanumeric': 0.10328185328185328, 'fraction_numerical': 0.0, 'mean_word_length': 5.0791788856304985, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3969081', 'n_tokens_mistral': 582, 'n_tokens_neox': 560, 'n_words': 183}