JSFiddle - React, Tailwind, and code Playground
by trolleymusic
JavaScript
var $ = {};
$.ajax = function () {
var xhr = function () {
var f = function () {
return this;
}
this.done = f;
this.fail = f;
this.always = f;
}
return new xhr();
}
console.log($.ajax().done());
console.log($.ajax().fail());
console.log($.ajax().always());
console.log($.ajax().done().fail().always());