You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
var p = Promise.reject( "Oops" ).defer();
var p2 = Promise.reject( "Oops" ); // will be reported as an unhandled rejection to the console
Can now be coded with
var p = Promise.reject( "Oops" ).catch(function(){});
var p2 = Promise.reject( "Oops" ); // will be reported as an unhandled rejection to the console
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?
The text was updated successfully, but these errors were encountered:
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.
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?The text was updated successfully, but these errors were encountered: