Skip to main content

CommonThrottle

Callable

  • CommonThrottle<argsT, retT>(func: (...args: argsT) => retT): (waitInterval: number, ...args: argsT) => retT

  • Creates a throttling wrapper for the provided function with the provided wait time. If the wrapped function has been successfully called within the wait time, further call attempts will be delayed until the wait time has passed.


    Type parameters

    • argsT: any[]
    • retT

    Parameters

    • func: (...args: argsT) => retT

      The function to throttle

      Returns (waitInterval: number, ...args: argsT) => retT

      • A throttled version of the provided function
        • (waitInterval: number, ...args: argsT): retT
        • Parameters

          • waitInterval: number
          • rest...args: argsT

          Returns retT