maybe a naming like: `Promise.allObject`
```js
Promise.allObject = obj => {
if (obj && !obj[Symbol.iterator]) {
return Promise.all(
Object.entries(obj).map(async ([k, v]) => [k, await v])
)
.then(Object.fromEntries);
}
return Promise.all(obj);
}
var delay = t => new Prom
Established name is Promise.properties
On Mon, 14 Oct 2019, 09:29 Cyril Auburtin, wrote:
> maybe a naming like: `Promise.allObject`
>
> ```js
> Promise.allObject = obj => {
> if (obj && !obj[Symbol.iterator]) {
> return Promise.all(
> Object.entries(obj).map(async ([k, v]) => [k, awa
The RSVP library uses Promise.hash, which seems sensible enough that I'm
surprised no-one has mentioned or suggested it here.
--
Dammit babies, you've got to be kind.
On Mon, 14 Oct 2019 at 09:17, Michał Wadas wrote:
> Established name is Promise.properties
>
> On Mon, 1
On Fri, Oct 11, 2019 at 9:53 PM Jacob Bloom wrote:
> What about special handling for Maps? Maybe something like
>
> ```
> const requests = new Map();
> requests.set('reqA', fetch('...'));
> requests.set('reqB', fetch('...'));
> const responses = await Promise.all(requests);
> console.log(
> resp
On Sat, Oct 12, 2019 at 7:19 AM Andrea Giammarchi
wrote:
> in order to work, `await` must be executed in an async scope/context (either
> top level or within a closure).
>
> In such case, either somebody is awaiting the result of that `async`
> execution, or the order doesn't matter.
That's def
5 matches
Mail list logo