News for hackers. Stuff that matters.
Re:Folding Promises in JavaScript by todd3834 on Thursday September 21, 2017 @10:48AM (#15303945)
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.
Re:Folding Promises in JavaScript by dvlsg on Thursday September 21, 2017 @12:43PM (#15305236)
If item is already a promise, and not a function returning a promise, they would be "executing" in parallel.
Re:Folding Promises in JavaScript by codefined on Thursday September 21, 2017 @10:53AM (#15304009)
Sorry, in the sense of being identical to the original code in the linked post (reduce), not the comment.