MCPcopy Create free account
hub / github.com/angular/angular / mockCancelIdleCallback

Function mockCancelIdleCallback

packages/core/test/acceptance/defer_spec.ts:1819–1832  ·  view source on GitHub ↗
(id: number)

Source from the content-addressed store, hash-verified

1817 };
1818
1819 const mockCancelIdleCallback = (id: number) => {
1820 onIdleCallbackQueue.delete(id);
1821
1822 // Decrement per-bucket active count.
1823 const timeoutKey = idToTimeout.get(id);
1824 if (timeoutKey !== undefined) {
1825 const count = activePerTimeout.get(timeoutKey) ?? 0;
1826 activePerTimeout.set(timeoutKey, Math.max(0, count - 1));
1827 idToTimeout.delete(id);
1828 }
1829
1830 idleCallbacksRequested--;
1831 idleCallbacksCancelled++;
1832 };
1833
1834 const triggerIdleCallbacks = () => {
1835 for (const [_, callback] of onIdleCallbackQueue) {

Callers

nothing calls this directly

Calls 4

getMethod · 0.65
setMethod · 0.65
deleteMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected