@vsokolov/utils - v0.32.0
    Preparing search index...

    Function throttle

    • Type Parameters

      • Args extends unknown[]

      Parameters

      • fn: (...args: Args) => void

        Function to debounce used to improve the performance of frequently executed actions. Guarantees the regular execution of an action.

      • cooldown: number

        Timer arg

      Returns (...args: Args) => void

      a new function, which when executed, stores the call arguments and starts the cooldown timer