Function
addCallback
(callback: (fps: number, minFps?: number) => void)
Source from the content-addressed store, hash-verified
| 69 | } |
| 70 | |
| 71 | export function addCallback(callback: (fps: number, minFps?: number) => void): number { |
| 72 | const id = idCounter; |
| 73 | |
| 74 | // Wrap all calback in zonedCallback so that they work with the current zone. |
| 75 | callbacks[id] = zonedCallback(callback); |
| 76 | idCounter++; |
| 77 | |
| 78 | return id; |
| 79 | } |
| 80 | |
| 81 | export function removeCallback(id: number) { |
| 82 | if (id in callbacks) { |
Tested by
no test coverage detected