• Throttle execution of a function. Especially useful for rate limiting execution of handlers on events like resize and scroll.

    Returns

    A new, throttled, function.

    Type Parameters

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

    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: T

      A function to be executed after delay milliseconds. The this context and all arguments are passed through, as-is, to callback when the throttled-function is executed.

    • Optional options: ThrottleOptions

      An object to configure options.

    Returns throttle<T>

Generated using TypeDoc