Skip to content

waitFor ​

Function of @v12-engine/engine

ts
export declare function waitFor<T, D = any>(event: EventKey<T>, test?: (world: World, payload: T, data: D, run: number) => boolean): WaitFor<D>;

Waits for an event, the engine's ('constructionFinished') or a game's own, and for test to pass on what it says when there is one. Heard at the end of the tick, like listeners hear events