A task which will be executed after a given delay.

Type Parameters

  • T = void

Hierarchy

  • DelayedTask

Constructors

Methods

Constructors

  • Type Parameters

    • T = void

    Parameters

    • pTask: (() => Promise<T>)
        • (): Promise<T>
        • Returns Promise<T>

    Returns DelayedTask<T>

Methods

  • Starts the execution of the task. The task will be executed only once if consecutive calls are made during the delay.

    Parameters

    • pDelay: number

      Delay in milliseconds before the task gets executed.

    • pRestartTimer: boolean = false

      If true and the delay timer is currently running, the timer will be restartet with the new delay. If false the currently running timer will stay active and the new delay is ignored. (default: false)

    Returns Promise<T>

Generated using TypeDoc