bang await chaining operator

// this is verbose
const response  = await fetch('/posts')
const posts = await response.json()

// chaining multiple await expressions in one line is awkward
const posts = await (await fetch('/posts')).json()

// proposal: chain together multiple awaits with !.
const posts = await fetch('/posts')!.json()
2 Likes

This has been dubbed the wavy dot

await fetch('/posts')~.json();
3 Likes

Awesome, glad this idea already has some notoriety.

1 Like