MCPcopy
hub / github.com/tldraw/tldraw / setTimeout

Method setTimeout

packages/utils/src/lib/timers.ts:60–65  ·  view source on GitHub ↗

* 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[])

Source from the content-addressed store, hash-verified

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.

Callers 1

forContextMethod · 0.95

Calls 3

setTimeoutMethod · 0.65
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected