MCPcopy
hub / github.com/tldraw/tldraw / setInterval

Method setInterval

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

* Creates an interval that will be tracked under the specified context. * @param contextId - The context identifier to group this timer under. * @param handler - The function to execute repeatedly. * @param timeout - The delay in milliseconds between executions (default: 0). * @param args -

(contextId: string, handler: TimerHandler, timeout?: number, ...args: any[])

Source from the content-addressed store, hash-verified

80 * @public
81 */
82 setInterval(contextId: string, handler: TimerHandler, timeout?: number, ...args: any[]): number {
83 const id = window.setInterval(handler, timeout, args)
84 const current = this.intervals.get(contextId) ?? []
85 this.intervals.set(contextId, [...current, id])
86 return id
87 }
88
89 /**
90 * Requests an animation frame that will be tracked under the specified context.

Callers 1

forContextMethod · 0.95

Calls 3

setIntervalMethod · 0.65
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected