Re: Modify Promise.all() to accept an Object as a parameter

2019-10-13 Thread Isiah Meadows
Maybe Promise.join(object)? Also, if a map is passed (or any iterable), it should be joined into a map. At the most basic level: ```js Promise.join = (o) => { let isMap = o[Symbol.iterator] != null let ps = ( isMap ? Array.from : Object.entries )(o) let ks = ps.map(p =>

Re: Modify Promise.all() to accept an Object as a parameter

2019-10-13 Thread Cyril Auburtin
OP probably means he would like Promise.all to return an object as well, if an object if given It's possible to hack an object to be iterable, but Promise.all already return an array unfortunately On Sun, Oct 13, 2019 at 7:16 PM Boris Zbarsky wrote: > On 10/12/19 12:52 AM, Jacob Bloom wrote: >

Re: Modify Promise.all() to accept an Object as a parameter

2019-10-13 Thread Boris Zbarsky
On 10/12/19 12:52 AM, Jacob Bloom wrote: const responses = await Promise.all(requests); As opposed to: const responses = await Primise.all(requests.values()); which works right now? -Boris ___ es-discuss mailing list es-discuss@mozilla.org