• Get a function that reduces calls to the function passed in

    Type Parameters

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

    Parameters

    • fn: T

      The function to debounce

    • delay: number = 300

      How much delay in milliseconds after the most recent call to the debounced function to call the function

    Returns T

    Function that, when called, only calls the function passed in at maximum every delay ms