3D-City Model
    Preparing search index...

    IntervalExecutor – Periodically executes a callback and emits its result as a window CustomEvent.

    Useful for broadcasting regular updates (e.g., polling data, status, or timer-based tasks).

    The function to invoke on each interval. Receives an emit function as its argument (i.e., callback(emit)).

    Unique identifier for this executor (used as eventName fallback).

    Interval duration in seconds.

    Name for the CustomEvent emitted on each run (falls back to id if not set).

    const exec = new IntervalExecutor({
    callback: emit => emit(Date.now()),
    duration: 1,
    eventName: "heartbeat"
    });

    window.addEventListener("heartbeat", e => console.log("Tick:", e.detail));
    Index

    Constructors

    Properties

    callback: any

    The executed callback.

    duration: any

    Interval duration in seconds.

    eventName: any

    CustomEvent name for emissions.

    id: any

    The unique identifier for this interval instance.

    intervalId: null | Timeout

    Internal .setInterval handle.

    Methods

    • Emit the given value as a CustomEvent (eventName) on window.

      Parameters

      • value: any

        Value to send in event.detail.

      Returns void