apex / apex/node-apex

Support array of promises

Aperta
#5 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
277
Fork
13
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

If the lambda function returns an array, this module doesn't treat it as a promise and will just do `cb` on the pending promises. I suggest:

```
if (Array.isArray(v)) {
Promise.all(v).then(function (val) /* etc. */
}
```

We can also just wrap `v` in `Promise.all` regardless since it will work even for non-arrays. It would be slightly less efficient to do this. There is also no guarantee that there is a promise in the array.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.