2 ms·
ECMAScript 7 has brought true async/await into the language, which currently works in Babel on top of Promises. As far as a regular user is concerned, define a
by girvo 11y ago
ECMAScript 7 has brought true async/await into the language, which currently works in Babel on top of Promises. As far as a regular user is concerned, define a function as "async" and then "await" on the result you're after inside of it. Hardly difficult, in my opinion!
- spankalee 11y agoasync/await is nice syntax, but it doesn't change the fundamental difference between synchronous and asynchronous code and the viral nature of async functions. Sync functions cannot properly compose async functions in general. A great essay on this is "What Color is Your Function": http://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/ http://journal.stuffwithstuff.com/2015/02/01/what-color-is-y...