* Creates a timeout that will be tracked under the specified context. * @param contextId - The context identifier to group this timer under. * @param handler - The function to execute when the timeout expires. * @param timeout - The delay in milliseconds (default: 0). * @param args - Additio
(contextId: string, handler: TimerHandler, timeout?: number, ...args: any[])
| 58 | * @public |
| 59 | */ |
| 60 | setTimeout(contextId: string, handler: TimerHandler, timeout?: number, ...args: any[]): number { |
| 61 | const id = window.setTimeout(handler, timeout, args) |
| 62 | const current = this.timeouts.get(contextId) ?? [] |
| 63 | this.timeouts.set(contextId, [...current, id]) |
| 64 | return id |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * Creates an interval that will be tracked under the specified context. |
no test coverage detected