Type Alias Continuously

Continuously: HasCompletion & {
    get elapsedMs(): number;
    interval: Interval;
    get isDisposed(): boolean;
    cancel(): void;
    reset(): void;
    start(): void;
}

Runs a function continuously, returned by continuously

Type declaration

  • get elapsedMs(): number

    How many milliseconds since loop was started after being stopped.

  • get interval(): Interval

    Gets the current interval, ie. speed of loop.

  • set interval(interval: Interval): void

    Sets the interval speed of loop. Change will take effect on next loop. For it to kick in earlier, call .reset() after changing the value.

  • get isDisposed(): boolean

    If disposed, the continuously instance won't be re-startable

  • cancel:function
    • Stops loop. It can be restarted using .start()

      Returns void

  • reset:function
    • (Re-)starts the loop. If an existing iteration has been scheduled, this is cancelled and started again.

      This can be useful when adjusting the interval

      Returns void

  • start:function
    • Starts loop. If already running, does nothing

      Returns void