Skip to main content
Module

x/timers/Base.ts>Base

All timing functions you need - for Deno and the browser
Go to Latest
class Base
Abstract
import { Base } from "https://deno.land/x/timers@v0.1.0/Base.ts";

Constructors

new
Base(
cb: Listener<T>,
delay: number,
options: BaseOptions<T>,
)

Type Parameters

optional
T extends any[] = any[]

Properties

protected
_isAborted: boolean

A boolean value that indicates whether the timer has been aborted

protected
_persistent: boolean

Indicates whether the process should continue to run as long as the timer exists. This is true by default.

protected
_ran: boolean

Indicates whether the timer ran already

protected
_resolveAborted: (value: AbortException) => void
protected
_running: boolean

Indicates whether the timer is currently running

protected
_timeLeft: number
protected
optional
_timer: number

The timer Id

readonly
aborted: Promise<AbortException>

A Promise, that resolves when the timer gets aborted

readonly
isAborted

A boolean value that indicates whether the timer has been aborted

readonly
options: BaseOptions<T>
readonly
persistent

Indicates whether the process should continue to run as long as the timer exists. This is true by default.

readonly
ran

Indicates whether the timer ran already

readonly
running

Indicates whether the timer is currently running

readonly
timer

The timer Id

Methods

abstract
abort(reason?: any): void

aborts the timer

ref()

makes the process not continue to run as long as the timer exists

abstract
run(): number

runs the timer

makes the process not continue to run as long as the timer exists