Constructors
constructor
- new AsyncInterval(
handler: (abortSignal: AbortSignal) => Promise<void>,
interval: number,
): AsyncInterval Parameters
- handler: (abortSignal: AbortSignal) => Promise<void>
- interval: number
Methods
onError
- onError(handler: (err: unknown) => void): void
Parameters
- handler: (err: unknown) => void
Returns void
start
- start(after?: number): void
Returns void
startNow
- startNow(): void
Returns void
setInterval() alternative built with async functions in mind
usage:
errors are ignored by default, but you can add a handler via
onError
method