(callback: VoidFunction)
| 77 | } |
| 78 | |
| 79 | remove(callback: VoidFunction) { |
| 80 | const key = this.callbackBucket.get(callback); |
| 81 | if (key === undefined) return; |
| 82 | |
| 83 | this.callbackBucket.delete(callback); |
| 84 | |
| 85 | const bucket = this.buckets.get(key); |
| 86 | if (!bucket) return; |
| 87 | |
| 88 | bucket.queue.delete(callback); |
| 89 | |
| 90 | // If the last callback in this bucket was removed, cancel the |
| 91 | // idle callback - cancel it. |
| 92 | if (bucket.queue.size === 0) { |
| 93 | this.cancelBucket(bucket); |
| 94 | this.buckets.delete(key); |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | private scheduleBucket(bucket: IdleBucket, options?: IdleRequestOptions) { |
| 99 | if (bucket.idleId !== null) { |
nothing calls this directly
no test coverage detected