# @f/bind-middleware

> Bind middleware to a context and optionally a next function..

Latest version **1.1.1** (published 2016-01-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @f/bind-middleware
pnpm add @f/bind-middleware
yarn add @f/bind-middleware
bun add @f/bind-middleware
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2016-01-03 |
| First published | 2016-01-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | f |

## Links

- npm: https://www.npmjs.com/package/@f/bind-middleware
- Repository: https://github.com/micro-js/bind-middleware
- Homepage: https://github.com/micro-js/bind-middleware#readme
- Issues: https://github.com/micro-js/bind-middleware/issues
- npm.io page: https://npm.io/package/@f/bind-middleware

## Dependencies (3)

- [@f/is-array](https://npm.io/package/@f/is-array.md) ^1.1.1
- [@f/clone-obj](https://npm.io/package/@f/clone-obj.md) ^1.1.2
- [@f/compose-middleware](https://npm.io/package/@f/compose-middleware.md) ^2.0.0

## Recent versions

- 1.1.1 (latest) — 2016-01-03
- 1.1.0 — 2016-01-03

## README

# bind-middleware

[![Build status][travis-image]][travis-url]
[![Git tag][git-image]][git-url]
[![NPM version][npm-image]][npm-url]
[![Code style][standard-image]][standard-url]

Bind middleware to a context with a dispatch and optionally a next function, so that
actions can be dispatched to the middleware stack.

## Installation

    $ npm install @f/bind-middleware

## Usage

```js
var bindMiddleware = require('@f/bind-middleware')

var logger = require('redux-logger')
var thunk = require('redux-thunk')

var dispatch = bindMiddleware([
  thunk,
  logger()
])

dispatch(dispatch => {
  setTimeout(() => {
    dispatch({type: 'INCREMENT'})
  })
})

// log => {type: `INCREMENT`}

```

## API

### bindMiddleware(middleware, ctx, next)

- `middleware` - array of redux middleware
- `ctx` - context to pass to middleware
- `next` - final next

**Returns:** A dispatch function with signature `dispatch(action)` that
dispatches to middleware stack.

## License

MIT

[travis-image]: https://img.shields.io/travis/micro-js/bind-middleware.svg?style=flat-square
[travis-url]: https://travis-ci.org/micro-js/bind-middleware
[git-image]: https://img.shields.io/github/tag/micro-js/bind-middleware.svg
[git-url]: https://github.com/micro-js/bind-middleware
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat
[standard-url]: https://github.com/feross/standard
[npm-image]: https://img.shields.io/npm/v/@f/bind-middleware.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@f/bind-middleware

---
_Source: https://npm.io/package/@f/bind-middleware · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
