GeoLeaf Core API - v3.0.0
    Preparing search index...
    • Caps a function to at most one call per limit milliseconds.

      Unlike debounce, a steady stream of calls still gets through at a fixed rate rather than being held until it stops — which is what a scroll or pan handler needs.

      ⚠️ Same never[] constraint as debounce, and for the same reason — see its note. Corrected here in the same gesture on 31/07/2026: the defect was identical and latent, invisible only because no published example happened to call throttle with a typed callback. Fixing one and not its twin would have left the next documenter to rediscover it.

      Type Parameters

      • T extends (...args: never[]) => unknown

      Parameters

      • func: T

        Function to throttle. this and arguments are forwarded.

      • limit: number = 100

        Minimum interval between calls, in milliseconds. Defaults to 100.

      Returns (...args: Parameters<T>) => void

      The throttled wrapper. ⚠️ It returns void — the wrapped return value is lost.