Class Timer

A Timer that lives in the mock clock

Hierarchy

  • Timer

Constructors

Properties

Methods

Constructors

  • Parameters

    • clock: Clock
    • w: number
    • f: ((...a) => any)
        • (...a): any
        • Parameters

          • Rest ...a: any[]

          Returns any

    Returns Timer

Properties

_onTimeout: null | ((...a) => any)

use the property name _onTimeout so that the global clearTimeout method in Node will make it no-op if it gets passed there.

Type declaration

    • (...a): any
    • Parameters

      • Rest ...a: any[]

      Returns any

clock: Clock

Clock governing this timer

reffed: boolean = true

set by unref

These timers don't keep the event loop open anyway, so this doesn't do much, but it's useful when testing to ensure that a timeout had .ref() or .unref() called on it.

w: number

When this timer should fire

Methods

  • Remove this timer from the clock's queue.

    Returns void

  • simulacrum of node's Timer.ref. Just sets the ref field.

    Returns void

  • simulacrum of node's Timer.unref. Just sets the ref field.

    Returns void

Generated using TypeDoc