- timer<T>(handlerOrOpts?: {
controller?: PromiseCancellableController;
delay?: number;
handler?: ((signal: AbortSignal) => T | PromiseLike<T>);
lazy?: boolean;
} | ((signal: AbortSignal) => T | PromiseLike<T>), delay?: number, lazy?: boolean, controller?: PromiseCancellableController): ResourceAcquire<Timer<T>>
-
Parameters
-
Optional
handlerOrOpts: {
controller?: PromiseCancellableController;
delay?: number;
handler?: ((signal: AbortSignal) => T | PromiseLike<T>);
lazy?: boolean;
} | ((signal: AbortSignal) => T | PromiseLike<T>)
-
delay: number = 0
-
lazy: boolean = false
-
Optional
controller: PromiseCancellableController
Returns ResourceAcquire<Timer<T>>
Timer resource Use it with
withF
orwithG
.