How about awaiting Arrays ?

Michał Wadas michalwadas at gmail.com
Fri Mar 3 16:59:10 UTC 2017


My mistake Array.from is not necessary because Promise.all accepts any
iterable.

Though I don't believe .race to be common use case (especially when we
consider it's edge case with empty array).

Hsving parity with spread and rest parameters seems consistent for me.

On 3 Mar 2017 17:54, "T.J. Crowder" <tj.crowder at farsightsoftware.com> wrote:

> On Fri, Mar 3, 2017 at 4:51 PM, Michał Wadas <michalwadas at gmail.com>
> wrote:
> > Actually I would go with
> >
> > await ...expr;
> >
> > As sugar for:
> >
> > await Promise.all(Array.from(expr))
>
> Which is great for `Promise.all`, but leaves us without `race` or things
> that may be added in future (like Andrea's `any`). (Granted `all` has to be
> the dominant use case...)
>
> Why the `Array.from` part of that?
>
> -- T.J.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170303/515d539e/attachment.html>


More information about the es-discuss mailing list