Awaiting block expression

Colin Cheng 1912656953 at qq.com
Fri Jun 21 15:08:28 UTC 2019


How about like do expression:

```javascript
const image = await (async do {
   	const user = await fetch('/user/'+id).json();
    await fetch('/image/'+user.image).json()
})
```
On Jun 21, 2019 14:41, Tobias Buschor <tobias.buschor at shwups.ch> wrote:
>
> As there are more and more async apis, i would like to have a block, where all promises within automaticly are awaited:
>
> Proposal:
>
> const image = await {
>     const user = fetch('/user/'+id).json();
>     fetch('/image/'+user.image).json();
> }
>


More information about the es-discuss mailing list