composedly
v1.0.2
Published
Named composed middleware
Downloads
4
Maintainers
Readme
composedly
Create compositions of middleware and named it.
Note: When you create compositions of middleware using koa-compose
or composition, it just returns an anonymousGeneratorFunction
.
And if you want to enableDEBUG
model in Koa, nothing is displayed.
Usage
var compose = require('composedly')
function* bar(next) {
yield* next
}
function* foo() {
return this
}
var fn = compose('composedly', bar, foo);
// Now, `fn.name` is 'composedly'
co(function* () {
yield* fn.call(true);
})();
API
composedly(name, fn...)
- name - String
- fn - GeneratorFunction
Dependencies
- composition - Create compositions of middleware.
- function-name - Set the "name" property of Function objects.
License
MIT