A TimeoutSlot provides a way to have a managed window timeout that can be added to a disposer, and guarantee that there is only one timeout active at a time.

Implements

Constructors

Accessors

Methods

Constructors

Accessors

  • get active(): boolean
  • Returns true if there is an active timeout pending.

    Returns boolean

Methods

  • Clears the existing timeout.

    Returns void

  • Clears the timeout and throws an error if a new one is attempted to be set.

    Returns void

  • Sets a timeout, clearing any existing timeout first.

    Parameters

    • callback: (() => void)

      The callback to invoke after the given time has elapsed.

        • (): void
        • Returns void

    • Optionaltime: number

      The amount of time to wait, in seconds.

    Returns void