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: any[]) => void
    • options: object

    Returns DebouncedFunction<(...args: any[]) => void>