Skip to content

REVO / API version 0.0.10

waitFor

waitFor(callback, timeout?): Promise<void>

Checks the callback each frame, starting on a later frame, until it returns true. Rejects on timeout, a thrown exception or a non-boolean result. Timeout handling matches setTimeout. Pending waits are abandoned when the script stops.

Parameter Type Description
callback () => boolean -
timeout? number Timeout in milliseconds. Default: 5000.

Promise<void>