Re:Folding Promises in JavaScript
by codefined on Thursday September 21, 2017 @10:21AM
(#15303672)
Is identical, doesn't use 'cool' reduce features but is much easier to read in my opinion.
[ Parent
| on HN ]
Wouldn’t this code only execute 1 promise at a time? I thought Promise.all allowed promises to be resolved in parallel
Re:Folding Promises in JavaScript
by theprotocol on Thursday September 21, 2017 @10:54AM
(#15304020)
Indeed. You most likely should do `await Promise.all` and then do the reduction.
If item is already a promise, and not a function returning a promise, they would be "executing" in parallel.