returns a function that, when invoked will only be triggered at most once during a given window of time

  • Type Parameters

    • R
    • A extends any[]

    Parameters

    • fn: ((...args: A) => R)

      the function to be throttled.

        • (...args): R
        • Parameters

          • Rest...args: A

          Returns R

    • delay: number

      the delay in ms

    Returns [((...args: A) => undefined | R), (() => void)]

    the function that will be throttled