source: trip-planner-front/node_modules/rxjs/_esm5/internal/util/Immediate.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 816 bytes
Line 
1/** PURE_IMPORTS_START PURE_IMPORTS_END */
2var nextHandle = 1;
3var RESOLVED = /*@__PURE__*/ (function () { return /*@__PURE__*/ Promise.resolve(); })();
4var activeHandles = {};
5function findAndClearHandle(handle) {
6 if (handle in activeHandles) {
7 delete activeHandles[handle];
8 return true;
9 }
10 return false;
11}
12export var Immediate = {
13 setImmediate: function (cb) {
14 var handle = nextHandle++;
15 activeHandles[handle] = true;
16 RESOLVED.then(function () { return findAndClearHandle(handle) && cb(); });
17 return handle;
18 },
19 clearImmediate: function (handle) {
20 findAndClearHandle(handle);
21 },
22};
23export var TestTools = {
24 pending: function () {
25 return Object.keys(activeHandles).length;
26 }
27};
28//# sourceMappingURL=Immediate.js.map
Note: See TracBrowser for help on using the repository browser.