2014-12-29 19:14:13 +00:00
|
|
|
"use strict";
|
|
|
|
|
2019-03-04 17:30:51 +00:00
|
|
|
const { JSDOM } = require( "jsdom" );
|
2014-12-29 19:14:13 +00:00
|
|
|
|
2019-03-04 17:30:51 +00:00
|
|
|
const { window } = new JSDOM( "" );
|
2014-12-29 19:14:13 +00:00
|
|
|
|
2023-09-19 16:58:24 +00:00
|
|
|
const { jQueryFactory } = require( "jquery/factory" );
|
|
|
|
const jQuery = jQueryFactory( window );
|
2014-12-29 19:14:13 +00:00
|
|
|
|
2019-03-04 17:30:51 +00:00
|
|
|
module.exports.deferred = () => {
|
|
|
|
const deferred = jQuery.Deferred();
|
|
|
|
|
|
|
|
return {
|
|
|
|
promise: deferred.promise(),
|
|
|
|
resolve: deferred.resolve.bind( deferred ),
|
|
|
|
reject: deferred.reject.bind( deferred )
|
2014-12-29 19:14:13 +00:00
|
|
|
};
|
2019-03-04 17:30:51 +00:00
|
|
|
};
|