init source

This commit is contained in:
Le Viet
2022-03-07 22:07:57 +07:00
parent e4376f3777
commit 8aba590a8d
11240 changed files with 1012977 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var nextHandle = 1;
var tasksByHandle = {};
function runIfPresent(handle) {
var cb = tasksByHandle[handle];
if (cb) {
cb();
}
}
exports.Immediate = {
setImmediate: function (cb) {
var handle = nextHandle++;
tasksByHandle[handle] = cb;
Promise.resolve().then(function () { return runIfPresent(handle); });
return handle;
},
clearImmediate: function (handle) {
delete tasksByHandle[handle];
},
};
//# sourceMappingURL=Immediate.js.map