Function throttle

  • A utility that creates a resource allowing us to throttle execution of a function. Especially useful for rate limiting execution of handlers on events like resize and scroll.

    Type Parameters

    • Value = unknown

    Parameters

    • delay: number

      A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.

    • callback: (() => Value)

      A function to be executed after delay milliseconds.

        • (): Value
        • Returns Value

    Returns Value

Generated using TypeDoc