-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add compose.hook or similar #6
Comments
One thing I'm not sure about is what to call "events". The current debug code is using using on var compose = require("koa-compse");
compose.on("down", function(ctx, name){ console.log(name, "has started"); });
compose.on("up", function(ctx, name){ console.log(name, "has finished"); }); using hook var compose = require("koa-compse");
compose.hook(function(ctx, name, direction){
if(direction=="down"){
console.log(name, "has started");
}
else{
console.log(name, "has finished");
}
}); |
we could implement it as more middleware that get injected inbetween, so you'd just do a normal |
I see the value of adding this to koa but how would koa inject debugging On Wed, Mar 12, 2014 at 9:59 PM, TJ Holowaychuk [email protected]:
|
Is there any consensus on this yet? I'd like to get an implementation merged. |
With the Koa v2 release in sight, I'd like to get a wrapper implementation merged. How should I work towards this goal? |
Is this still an open issue, or could there be consensus on the hope of node 8's experimental async_hook to rescue the situation soon enough? |
I think |
Heh, yea. To be fair, that was the only use case I had in mind anyway. |
There is |
some API for extending externally, for example the new debug stuff I just added could live in a different module. I'd like to provide a nicer alternative that outputs HTML documents since the terminal quickly becomes a clusterfuck, especially with parallel requests
The text was updated successfully, but these errors were encountered: