In Koa I can accesss a Koa Context in the first generator function via this
:
app.use(function *(){
this; // is the Context
}
But if I yield to another generator function I can't access the context via this
anymore.
app.use(function *(){
yield myGenerator();
}
function* myGenerator() {
this.request; // is undefined
}
I've been able to simply pass the context to the second generator function, but was wondering whether there's a cleaner way to access the context.
Any ideas?