source: trip-planner-front/node_modules/rxjs/internal/util/Immediate.js@ 188ee53

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

initial commit

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