Skip to content
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

Library hooks #3

Open
domenic opened this issue Dec 11, 2012 · 2 comments
Open

Library hooks #3

domenic opened this issue Dec 11, 2012 · 2 comments
Labels

Comments

@domenic
Copy link
Member

domenic commented Dec 11, 2012

Like #2, but the hooks are put on the libraries themselves (e.g. Q.onUnhandledRejection = ... or Q.on("unhandledRejection", ...)).

This has the con of making it hard to write generic debugging tools, but the pro of not co-opting some environment feature (like console or the global object) for nefarious purposes.

@briancavalier
Copy link
Member

I much prefer the environment hooks of #2, but this would be a decent fallback if promise impls agree on naming for a core set of hooks to make it easier on debugging tools to be configured, or to discover them automagically.

FWIW, I don't really consider "providing a helpful debugging experience" to be nefarious :)

@ForbesLindesay
Copy link
Member

There would need to be a consistent method of discovering those libraries as well though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants