JSFiddle - React, Tailwind, and code Playground
by Ryan Neufeld
JavaScript
var d1 = $.Deferred();
var d2 = $.Deferred();
var p1 = d1.promise();
var p2 = d2.promise();
function doThisAlways(){
console.log(arguments);
}
$.when(p1, p2, "Truthy thing")
.fail(doThisAlways)
.done(doThisAlways)
.always(doThisAlways);
d2.reject("rejected!"); //Only seeing this
d1.resolve("resolved!"); //expecting this as well
console.log("Expecting", ['resolved!','rejected!', "Truthy thing"]);