Skip to main content

fromAnimationFrame

Types

function fromAnimationFrame(): IObservable<void>

Definition

Creates an Observable that emits 'void' on every animation frame.

Diagram

Example

Create an animation frame Observable to draw something

const subscribe = fromAnimationFrame();

const unsubscribe = subscribe(() => {
// draw something on a canvas
});