Async Do Expressions
github.com/bakkot/proposal-async-do-expressions
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.
How?
let x = async do {
let res = fetch(x);
(await res).json()
};
x.then(console.log);
Stage 1?