Looks like Promise.allSettled is the same as $.when() which is provided by jQuery, am I correct?
Both of them returns a Promise that will be executed when the inner promises are done.
I prefer 200% the when syntax than the allSettled.
No, $.when() is like Promise.all(), they both fail/reject as soon as one of the given promises rejects. Promise.allSettled will resolve when all given promises have either resolved or rejected, and then you have to manually check the results...
Looks like
Promise.allSettled
is the same as$.when()
which is provided by jQuery, am I correct?Both of them returns a Promise that will be executed when the inner promises are done.
I prefer 200% the
when
syntax than theallSettled
.Sound so much more succinct and readable!
No,
$.when()
is likePromise.all()
, they both fail/reject as soon as one of the given promises rejects.Promise.allSettled
will resolve when all given promises have either resolved or rejected, and then you have to manually check the results...Great! Thanks for the response!