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

Function mockCancelIdleCallback

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

Source from the content-addressed store, hash-verified

1804 };
1805
1806 const mockCancelIdleCallback = (id: number) => {
1807 onIdleCallbackQueue.delete(id);
1808
1809 // Decrement per-bucket active count.
1810 const timeoutKey = idToTimeout.get(id);
1811 if (timeoutKey !== undefined) {
1812 const count = activePerTimeout.get(timeoutKey) ?? 0;
1813 activePerTimeout.set(timeoutKey, Math.max(0, count - 1));
1814 idToTimeout.delete(id);
1815 }
1816
1817 idleCallbacksRequested--;
1818 idleCallbacksCancelled++;
1819 };
1820
1821 const triggerIdleCallbacks = () => {
1822 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