New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@koax/bind

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@koax/bind

Create a dispatch function for a koax middleware stack.

latest
Source
npmnpm
Version
0.3.4
Version published
Maintainers
1
Created
Source

bind

Build status Git tag NPM version Code style

Exposes a curried api to create a middleware dispatcher with promise and thunk support.

Installation

$ npm install @koax/bind

Usage

import bind from '@koax/bind'

let dispatch = bind({fetched: 'google'})(
  function * (action, next, ctx) {
    if (action === 'foo') return Promise.resolve('bar')
    return next()
  }
])

dispatch('foo').then((res) => res) // => 'bar'
disaptch('qux').then((res) => res) // => 'qux'

API

bind (ctx) => (middleware)

  • ctx - the context to bind the middleware to
  • middleware - array of koax middleware

Returns: dispatch function for koax middleware stack

License

MIT

FAQs

Package last updated on 11 Feb 2016

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