$.whenAll
is an extension to jQuery's $.when
. The main difference is $.when
stops when it receives the first rejected promise
. This extension treats all successes and failures as progress events. After all the promises have completed, the global promise is resolved if there were no errors. Otherwise the global promise is rejected.
$.whenAll($.get('http://github.com'), $.get('good luck with this one'))
.then(
// success callback
function(request) {}
// failure callback - called once at the end
,function() {}