Open benjamingr opened 9 years ago
Unfortunately, the book is already off to press now, so it's too late to sneak in anything for first edition. But it's worth keeping this around to see how it shakes out. AFAIK, this unhandledRejection
thing is not ES6 spec related, but a hosting-environment extension. I'd want to document it if it fully takes off as the de facto standard of how promise rejections are handled across browsers and ssjs's.
Yeah, it's not ES6 spec related - it's implemented on the serverside and there is a similar proposal for window.onerror
Just updating that it's also in the DOM now as window.addEventListener("unhandledrejection", ...
thanks!
In async & performance you mention promise rejections and debuggability with error handling. A patch has landed in io.js in 1.4 which is released tomorrow with native promises that lets you do something similar to your example:
Your example syntax:
Can now be coded with
When doing:
This will achieve semantics very close to your
.defer
semantics using native ES6 promises in io.js, I think it's worth mentioning :) How do you feel about this?