rejectIfConditionAtInterval
Callable
Type parameters
- T
Parameters
cond: AsyncFunction<undefined | T, unknown>
The function/condition to call.
interval: number
The interval in milliseconds.
Returns [Timer, Promise<never>]
- an array with the interval ID and the Promise.
Sets an interval that repeatedly executes the given cond function with the specified interval between each call. If the condition is met, the interval is cleared and a Promise that rejects with the returned value is returned.