frontend/.pnpm-store/v3/files/43/168136b19cacff8f9faf97a5d1a2ebb7e5d7c1d1794ef6be2a1552235a309b70c87f20a1a96c4c3c766964fe7dbcc277953279a1a70e50b3d634095afaabb4

35 lines
626 B
Plaintext

"use strict";
var delay = require("../../delay");
module.exports = function (t, a) {
if (typeof Promise !== "function") return null;
return {
Tick: function (d) {
var isInvoked = false;
t().then(function (result) {
isInvoked = true;
delay(function () {
a(result, undefined);
d();
})();
}, delay(d));
a(isInvoked, false);
},
Timeout: function (d) {
var isInvoked = false;
t(100).then(
delay(function (result) {
isInvoked = true;
a(result, undefined);
d();
}),
delay(d)
);
setTimeout(function () {
a(isInvoked, false);
}, 50);
}
};
};