1.0.0 • Published 9 years ago

@koax/ware v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 years ago

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