Function debounce

  • Debounces the input function.

    Parameters

    • func: (...args: any[]) => void

      Function to be debounced

    • wait: number

      Time to wait before calling the function

    Returns (...args: any[]) => void

    -Function that debounces the input function