kinetex - v1.0.0-rc.1
    Preparing search index...

    Function throttleProgress

    • Create a throttled version of a progress callback.

      This is a standalone throttle helper, different from the built-in throttle in ProgressTracker (which uses per-tracker throttling). Use this when you need to throttle progress across multiple trackers or when using the tracker without the built-in callback.

      Parameters

      • fn: (snap: ProgressSnapshot) => void

        The callback to throttle

      • hz: number = 10

        Maximum calls per second (default: 10)

      Returns (snap: ProgressSnapshot) => void

      Throttled callback that always emits when snap.done is true

      const throttled = throttleProgress((snap) => {
      console.log(`${snap.percent}%`);
      }, 5); // max 5 calls per second