DevSum16: David Vujic- JavaScript async: the future looks promising

Ta del av David Vujics session JavaScript async: the future looks promising

In the beginning there was the Pyramids. Well, not really: we actually had Ajax before that. With ajax we also got callbacks (and some of the mighty callback pyramids were built & are still standing).

About one year ago, ECMAScript 2015 (aka ES 6) was released and now we have native support for Promises: a standardized and more reliable way of writing async code. Instead of mighty pyramids, we now can build smaller callback pyramids. However, async JavaScript code – with or without Promises – isn’t always easy to understand. Promises does not solve the mismatch between how our brains are wired and the flow of callbacks & thenable promises. But the upcoming ECMAScript feature – called async/await – could actually do it!

In this session, I will code and talk about writing async JavaScript today, with different approaches like callbacks, promises and the magic of generators – and how we can write readable async production code (yes, I used the words ”readable” and ”async” in the same sentence), by using the new async/await keywords together with transpiler tools like Babel.