Promise.allSettled

The Promise object has many useful functions like all, resolve, reject, and race — stuff we use all the time. One function that many don’t know about is Promise.allSettled, a function that fires when all promises in an array are settled, regardless of whether any of the promises are resolved or rejected.

Promise.all is great but then isn’t called if a project is rejected:

Promise.all([
Promise.resolve(1),
Promise.resolve(true),
Promise.reject("Boooooo"),
])
.then(_ => console.log("Then!"))
.catch(e => console.

Check Full Content Here […]

ProvenWays.com is Available for Purchase. Learn more by clicking the button here:

Get More Info