MCPcopy Index your code
hub / github.com/angular/angular / add

Method add

packages/core/src/defer/idle_scheduler.ts:66–77  ·  view source on GitHub ↗
(callback: VoidFunction, options?: IdleRequestOptions)

Source from the content-addressed store, hash-verified

64 private readonly idleService = inject(IDLE_SERVICE);
65
66 add(callback: VoidFunction, options?: IdleRequestOptions) {
67 const key = getIdleRequestKey(options);
68 this.callbackBucket.set(callback, key);
69
70 let bucket = this.buckets.get(key);
71 if (bucket == null) {
72 bucket = {idleId: null, queue: new Set()};
73 this.buckets.set(key, bucket);
74 }
75 bucket.queue.add(callback);
76 this.scheduleBucket(bucket, options);
77 }
78
79 remove(callback: VoidFunction) {
80 const key = this.callbackBucket.get(callback);

Callers

nothing calls this directly

Calls 5

scheduleBucketMethod · 0.95
getIdleRequestKeyFunction · 0.85
setMethod · 0.65
getMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected