If I have a nondeterministic number of promises being generated how do I handle them as a group to ensure the all of the promises in the group have been resolved before I move forward in my code?
I though about using jQuery.when
but it looks like it requires a deterministic number of promises passed as arguments. I thought I would be able to pass an array of promises for processing but based upon the docs I think it will evaluate this array as a single resolved promise.
push all the promises into an array and use:
$.when.apply(null, promiseArray).done(function() {....
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With