1.0.0 • Published 9 years ago
@koax/ware v1.0.0
ware
`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
1.0.0
9 years ago