@ekim088/toolkit
    Preparing search index...

    Function debounce

    • Returns a debounced function that delays invocation until the function has reached a steady state for a defined delay period.

      Type Parameters

      • T extends (...args: any) => unknown

      Parameters

      • fn: T

        The function to debounce.

      • delay: number

        The number of milliseconds to wait before calling the function.

      Returns DebouncedFn<T>

      The debounced function. cancel() can be called on the function to cancel any pending calls, and flush() can be called to immediately call the function.