Function debounce

  • Convert a function call to debounced function call

    Type Parameters

    • T extends ((...args) => void)

    Parameters

    • callback: T

      function to call

    • delay: number = 300

      delay in debounce

    Returns ((...args) => void)

    debounced function

      • (...args): void
      • Parameters

        • Rest ...args: Parameters<T>

        Returns void