Skip to content

Documentation / @andrew_l/dom / animateInstantly

Function: animateInstantly()

animateInstantly(tick): void

Instantly animates by calling the tick function in rapid succession until it returns false.

This is intended for scenarios where the animation should run as quickly as possible, without any delay.

Parameters

tick: Function

The tick function to be executed on each frame. If it returns false, the animation stops.

Returns

void

Example

ts
animateInstantly(() => {
  // Your instant animation logic here
  return true; // Return `true` to continue animating, `false` to stop.
});