geoview-core - v2.1.2
    Preparing search index...

    Function doUntil

    • Repeatedly invokes a callback at a fixed interval until one of the following conditions is met:

      1. The callback returns a truthy value (early termination).
      2. The optional timeout duration is reached. The callback receives the elapsed time (in milliseconds) since the interval started. If startImmediately is true, the callback is invoked once immediately before the interval begins.

      Type Parameters

      • T

      Parameters

      • callback: (elapsed: number) => T

        Function executed on each interval tick. Receives the elapsed time (ms) since the start. If the function returns a truthy value, the interval is cleared immediately.

      • intervalMs: number

        Interval duration in milliseconds between each callback invocation.

      • Optionaltimeout: number

        Optional maximum duration in milliseconds before the interval is automatically cleared. If omitted, the interval runs until the callback stops it.

      • startImmediately: boolean = false

        If true, the callback is invoked once immediately before the interval is scheduled. Defaults to false.

      Returns DoUntilJob

      The job object containing the cancel function and interval ID.