* Requests an animation frame that will be tracked under the specified context. * @param contextId - The context identifier to group this animation frame under. * @param callback - The function to execute on the next animation frame. * @returns The request ID that can be used with cancelAnimat
(contextId: string, callback: FrameRequestCallback)
| 100 | * @public |
| 101 | */ |
| 102 | requestAnimationFrame(contextId: string, callback: FrameRequestCallback): number { |
| 103 | const id = window.requestAnimationFrame(callback) |
| 104 | const current = this.rafs.get(contextId) ?? [] |
| 105 | this.rafs.set(contextId, [...current, id]) |
| 106 | return id |
| 107 | } |
| 108 | |
| 109 | /** |
| 110 | * Disposes of all timers associated with the specified context. |
no test coverage detected