Function debounce

Creates a debounced version of a function.

  • Type Parameters

    • T extends ((...args: any[]) => any)

      The type of the original function.

    Parameters

    • run: T

      The function to debounce.

    • Optionaldelay: number = 1_000

      The delay in milliseconds before executing the debounced function.

    Returns T & IClearable

    • The debounced function with additional methods for clearing and flushing.