detritus

Timeoutclass

A setTimeout you can restart or stop without keeping the handle around.

On this page
import { Timers } from 'detritus-utils';

Timers.Timeout;
3 properties5 methodssrc/timers.ts:56

Constructor

new Timeout

new Timeout()

Properties

reference
any
Default null
shouldRef
boolean
Default true

Accessors

hasStarted
boolean
get

Methods

start()

src/timers.ts:86
start(milliseconds: number, handler: Function, override?: boolean): boolean

Returns if it was scheduled, false when it's already running and override is false hasStarted is false again by the time handler runs, so the handler can start it again

milliseconds
number
handler
Function
override?
boolean
Default true