Timeout.set()method
Cancel any existing timeout and set a new one.
set(callback: Callback | undefined = this._callback, ms: number = this._ms): void
new Timeout(callback: Callback | undefined = undefined, ms = 0)
| Param | Type | |
|---|---|---|
callback | Callback | A callback is a function that is called when something happens, optionally with multiple values. Defaults to undefined |
ms | unknown | Defaults to 0 |
| Return | |
|---|---|
Timeout | Stateful wrapper around setTimeout() that manages a single pending timeout at a time. |
| Property | Type | |
|---|---|---|
.exists | boolean | Whether a timeout is currently pending. required readonly |
Stateful wrapper around setTimeout() that manages a single pending timeout at a time.
setTimeout().Cancel any existing timeout and set a new one.
set(callback: Callback | undefined = this._callback, ms: number = this._ms): void
Cancel any existing timeout.
clear(): void