Waiter that polls for a condition to be met using requestAnimationFrame, with a timeout. This waiter checks the condition on every animation frame (typically ~60fps).
The type of the result of the condition.
Initializes a new instance of the RequestAnimationFrameWaiter class.
{() => T | Promise} A Function testing the condition to poll for.
{number} The timeout in milliseconds. If omitted, the timeout is zero, implying the check will execute once.
Waits for the condition to be met.
A Promise that resolves to the result of the condition. The Promise is rejected if the timeout is reached, or if the wait is cancelled.
Cancels the wait.
Waiter that polls for a condition to be met using requestAnimationFrame, with a timeout. This waiter checks the condition on every animation frame (typically ~60fps).