foundation-comms.until
Home > @genesislcap/foundation-comms > until
until() function
Polls a condition function until it returns true or a timeout is reached.
Signature:
export declare function until(conditionFunc: () => boolean, timeoutMs?: number): Promise<any>;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
conditionFunc |
() => boolean |
The condition function to poll. |
|
timeoutMs |
number |
(Optional) The timeout in milliseconds. Defaults to 300. |
Returns:
Promise<any>
A promise that resolves when the condition function returns true or rejects when the timeout is reached.