3 ms·
I've never heard of allSettled, but the difference seems clear to me. However, I think you would usually want the semantics of Promise.all, allSettled seems mor
by eloff 6y ago
I've never heard of allSettled, but the difference seems clear to me. However, I think you would usually want the semantics of Promise.all, allSettled seems more for niche use cases.
- proto-n 6y agoHaven't heard of it before either, but had to recreate the functionality before. Which is not all that hard using Promise.all
- locallost 6y agoIf you add a .catch to a promise, then it will never reject, so you get this with .all also. I'd also never heard of .allSettled which is a pity because I need it frequently. For instance when I have a bunch of requests that run in parallel, and I don't really care if they all succeed, just that they are all complete.