Proposal: `await [p1, p2]` (equivalent to `await Promise.all([p1, p2])`)

Olivier Lalonde olalonde at
Wed Oct 26 07:11:36 UTC 2016

I have no idea if this has been discussed already but I thought it'd be
nice to have the following syntax sugar for async/await.

The idea would be that any array that follows `await` would be wrapped into
a Promise.all() call. For example, `await [p1,p2]` would be the equivalent
of `await Promise.all([p1,p2])`.

It would make some more complex expressions easier to read:

  const downloads = await Promise.all( => client.get(reg.url, {
    responseType: 'arraybuffer',


  const downloads = await => client.get(reg.url, {
    responseType: 'arraybuffer',

In many async/await code bases, it might remove the last use case for
typing `Promise` directly.

- Oli

Oli Lalonde <-- connect with me!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list