Skip to main

requestAnimationFrame

requestAnimationFrame

Signature - util.ts#L136

declare function requestAnimationFrameImplementation(
    callback: (time: number) => void,
    subscription?: Disposable,
): void

Disposable-based alternative to built-in requestAnimationFrame.

Parameters

ParameterTypeDescription
callback
(time: number) => void

The callback to schedule. This will be called with a time parameter.

subscription
Disposable

If this is disposed then the request will be cancelled.