JSFiddle - React, Tailwind, and code Playground
JavaScript
var xhr1 = $.ajax({ url:'/echo/json/', data:{ delay: 3 } }),
xhr2 = $.ajax({ url:'/echo/json/something/invalid', data:{ delay: 3 } });
xhr1.always(function(){
console.log('xhr1 always');
});
xhr2.always(function(){
console.log('xhr2 always');
});
$.when.apply($, [xhr1, xhr2]).always(function(){
console.log('xhr1 & xhr2 always');
});