Function debounce

  • Creates a debounced function that only invokes func at most once per every delay milliseconds (or once per browser frame).

    See this article for additional details.

    Parameters

    • func: AnyFunc

      Function to debounce.

    • delay: number

      Delay in milliseconds.

    Returns AnyFunc

    The debounced function.