Function adaptiveThrottle

  • Return a function that can be called instead of callback, but guarantees a limited execution rate. The execution rate is calculated based on the runtime duration of the previous call. Example:

    throttledFoo = util.adaptiveThrottle(foo.bind(this), {});
    throttledFoo();
    throttledFoo();

    Parameters

    • this: unknown
    • callback: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • options: object

    Returns DebouncedFunction<((...args) => void)>