This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/rxjs/_esm2015/internal/util/Immediate.js

20 lines
479 B
JavaScript
Raw Normal View History

2019-08-11 18:48:02 +00:00
let nextHandle = 1;
const tasksByHandle = {};
function runIfPresent(handle) {
const cb = tasksByHandle[handle];
if (cb) {
cb();
}
}
export const Immediate = {
setImmediate(cb) {
const handle = nextHandle++;
tasksByHandle[handle] = cb;
Promise.resolve().then(() => runIfPresent(handle));
return handle;
},
clearImmediate(handle) {
delete tasksByHandle[handle];
},
};
//# sourceMappingURL=Immediate.js.map