2 ms·
I think that it works because when loop() rejects, Promise.all() rejects too so it doesn't matter who wins.
by scotty79 4y ago
I think that it works because when loop() rejects, Promise.all() rejects too so it doesn't matter who wins.
- remram 4y agoI mean in the case where nothing rejects. Say for example the loop was doing `result.push({success: true, value: item})` instead of just `result.push(item)`. Then the value returned from loop() is different from the one returned by Promise.all(promises), and your overall monitor() function might return either.