3 ms·
It seems like there's two ideas here: new error handling syntax, and new asynchronous task handling syntax. About asynchronous tasks: I think many people here m
by AgentME 12y ago
It seems like there's two ideas here: new error handling syntax, and new asynchronous task handling syntax. About asynchronous tasks: I think many people here might be interested in taskjs which combines Promises and ES6 generators (http://taskjs.org/ http://taskjs.org/) and the similar ES7 async function proposal (http://wiki.ecmascript.org/doku.php?id=strawman:async_functions http://wiki.ecmascript.org/doku.php?id=strawman:async_functi...). You can use await on a function that returns a promise and write code just like the code in this article (besides the error handling stuff). In basic sequential code, you never have to call .then() on a promise, but you're still able to dive down and do that if you have some non-linear asynchronous code that requires it.