I'm using the latest co-module (4.6).
This is a Koa-middleware. Therefore it is already co()
wrapped.
create: function * () {
try {
this.body = yield services.createIt({obj: true})
} catch (err) {
this.body = { "errors": err.details }
this.status = err.status
}
}
It is calling another generator-function I'm manually wrapping with co
:
const co = require('co')
createIt: co(function * (obj) {
console.log(obj) // --> undefined
}
Why do I "loose" the parameter?