@koax/ware

1.0.0 • Public • Published

ware

Build status Git tag NPM version Code style

`use` syntax for koax middleware

Installation

$ npm install @koax/ware

Usage

import ware from '@koax/ware'

let app = ware()

app.use(function * (action, next) {
  if (action === 'foo') return 'bar'
  return next()
})

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

API

ware()

Returns: dispatch function for koax middleware stack

.use(fn)

  • fn - function to add to middleware stack

Returns: dispatch function

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @koax/ware

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • koax