source: trip-planner-front/node_modules/rxjs/_esm2015/internal/util/Immediate.js@ fa375fe

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

initial commit

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