Skip to main

setInterval

setInterval

Signature - util.ts#L208

declare function setIntervalImplementation<T extends any[]>(
    callback: (...args: T) => void,
    delayMs?: number,
    subscription?: Disposable,
    ...args: T
): void

Disposable-based alternative to built-in setInterval.

Parameters

ParameterTypeDescription
callback
(...args: T) => void

The callback to schedule.

delayMs
number

The amount of delay.

subscription
Disposable

If this is disposed then the request will be cancelled.

args
T

The arguments to send to the callback.