Conffab by Web Directions
  • Speakers
  • Presentations
  • Conferences
  • Live streams
  • Topics
  • Pricing & Plans
  • Browse
  • Signup
  • Sign In
  • Speakers
  • Presentations
  • Conferences
  • Live streams
  • Topics
  • Pricing & Plans
  • Browse
  • Signup
  • Sign In

Search Conffab

Search presentations, speakers, transcripts, slides and topics.

Searching Conffab

Async and Await

James Hunter at Code 2015
Sign up for Conffab Free to watch this and hundreds of other videos for free
  • Details
  • References
  • Keypoints

A deep exploration of proposed es2016 (AKA ES7) async functions, their inner workings (generators, promises, iterables), and how they will make our systems easier to write and maintain.

https://slides.com/jameshunter/deck-4/

Warning to functional programmers: this talk is all about side effects. Sorry!

Talking about code styles as personified friends… pretty funny 😉

But why does async have to be so hard? Why can’t we write nice simple async code?

Well you can, eg. With libraries like bluebird to set up coroutines.

But then… what is this black magic? IT’S A HACK!

Three main points….

  1. iterators (control the rate data is returned)
  2. generators
  3. generators again! They have an advanced mode where you can feed values back in as well as get values out

ES2016 brings in async and await to make things much clearer and easier to write (and understand).

function  steve (x) {
const  y = inc()
return  x + y
}

vs.

async  function superSteve (x) {
const  y = await inc()
return  x + y
}

(Lots of code examples, easier to look up slides!)

 

 

You may also be interested in

Thumbnail for Pop-up Accessibility

Pop-up Accessibility

Rhiana Heath

Code 2015

Thumbnail for What Comes Next for the Web Platform?

What Comes Next for the Web Platform?

Alex Russell

Code 2015

Thumbnail for Console Dot

Console Dot

Warwick Cox

Code 2015

Thumbnail for Back to the Future with Web Components

Back to the Future with Web Components

Jonathon Creenaune

Code 2015

Thumbnail for Crossing The Streams

Crossing The Streams

Simon Knox

Code 2015

Thumbnail for Dawn of the Progressive Single Page App

Dawn of the Progressive Single Page App

Mark Dalgleish

Code 2015

Thumbnail for Eliminate JavaScript Code Smells

Eliminate JavaScript Code Smells

Elijah Manor

Code 2015

Thumbnail for ES6 Symbols, What They Are and How to Use Them

ES6 Symbols, What They Are and How to Use Them

Clark Pan

Code 2015

More presentations from Code 2015

Thumbnail for The State of the Animation

The State of the Animation

Rachel Nabors

Code 2015

Thumbnail for What Comes Next for the Web Platform?

What Comes Next for the Web Platform?

Alex Russell

Code 2015

Thumbnail for Async Frontiers in JavaScript

Async Frontiers in JavaScript

Domenic Denicola

Code 2015

Thumbnail for Classing up ES6

Classing up ES6

Andy Sharman

Code 2015

Thumbnail for Canvas Cold War

Canvas Cold War

Simon Swain

Code 2015

Thumbnail for Current Best Practice in Front End Ops

Current Best Practice in Front End Ops

Alex Sexton

Code 2015

Thumbnail for Stop the Fanaticism – Using the Right Tools for the Job

Stop the Fanaticism – Using the Right Tools for the Job

Kassandra Perch

Code 2015

Thumbnail for Pop-up Accessibility

Pop-up Accessibility

Rhiana Heath

Code 2015

© 2026

  • About
  • Speakers
  • Presentations
  • Conferences
  • Contact
  • Sign in
Sign Up