Awaiting block expression

Tobias Buschor tobias.buschor at shwups.ch
Fri Jun 21 06:41:51 UTC 2019


 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();
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20190621/005bc565/attachment.html>


More information about the es-discuss mailing list