Package Exports
- composition
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (composition) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Composition
Create compositions of middleware just like koa-compose. However, this is for general usage, not specifically for koa. In particular:
- No
debuginstrumentation - Returns the value of the first middleware.
Use this to create your own middleware platforms.
Example
var compose = require('composition')
co(function* () {
var fns = []
fns.push(function* (next) {
return yield* next
})
fns.push(function* () {
return this
})
var fn = compose(fns)
var res = yield* fn.call(true)
// => true
// because of `return this`
})