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

Function mockCancelIdleCallback

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

Source from the content-addressed store, hash-verified

1789 };
1790
1791 const mockCancelIdleCallback = (id: number) => {
1792 onIdleCallbackQueue.delete(id);
1793
1794 // Decrement per-bucket active count.
1795 const timeoutKey = idToTimeout.get(id);
1796 if (timeoutKey !== undefined) {
1797 const count = activePerTimeout.get(timeoutKey) ?? 0;
1798 activePerTimeout.set(timeoutKey, Math.max(0, count - 1));
1799 idToTimeout.delete(id);
1800 }
1801
1802 idleCallbacksRequested--;
1803 idleCallbacksCancelled++;
1804 };
1805
1806 const triggerIdleCallbacks = () => {
1807 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