Great post and explanation! I personally have dreaded not having an alternative to Promise.allSettled() as it has required me to rewrite much of my applications to still work with Promise.all(). It usually happens anytime there's a need to gather finalized data AFTER running async methods from an array.
rewrite much of my applications to still work with Promise.all()
How did you get around the issue of current short-circuit behavior of .all()? (write a custom .allSettled or used many try/catch blocks? Those are only two I can think of 🤔)
Possibly bad form, but I went the route of "misusing" resolve and reject. If there was a bad case that had issues, yet needed to be caught by Promise.all(), I returned an object that used the try/catch but searched for a specific flag.
Not the most efficient, but it worked and was easier to implement than rewriting the majority of the project!
Great post and explanation! I personally have dreaded not having an alternative to
Promise.allSettled()
as it has required me to rewrite much of my applications to still work withPromise.all()
. It usually happens anytime there's a need to gather finalized data AFTER running async methods from an array.Thank you, vulpz 😃
How did you get around the issue of current short-circuit behavior of
.all()
? (write a custom.allSettled
or used many try/catch blocks? Those are only two I can think of 🤔)Possibly bad form, but I went the route of "misusing"
resolve
andreject
. If there was a bad case that had issues, yet needed to be caught byPromise.all()
, I returned an object that used the try/catch but searched for a specific flag.Not the most efficient, but it worked and was easier to implement than rewriting the majority of the project!
Getting things done FTW~