1 of 5

Async Do Expressions

2 of 5

github.com/bakkot/proposal-async-do-expressions

3 of 5

Problem Statement

Introducing an async context requires defining and invoking a new function. That's conceptually and syntactically heavy. I want to make it easier.

4 of 5

How?

let x = async do {

let res = fetch(x);

(await res).json()

};

x.then(console.log);

5 of 5

Stage 1?