@embrace-io/web-sdk
Version:
8 lines • 653 B
TypeScript
/** throttle wraps a function so it can only be called once, and then a time window must pass before it can be called again
* any subsequent calls before the time window has passed will be ignored.
*
* NOTE: if the wrapped function makes use of "this", it must be properly bind from the caller, as this wrapper will not bind it.
* For this, we suggest you always pass functions declared as fat arrow functions, as they have their "this" lexically defined.
* */
export declare const throttle: <F extends (...args: Parameters<F>) => ReturnType<F>>(func: F, timeout?: number) => (...args: Parameters<F>) => void;
//# sourceMappingURL=throttle.d.ts.map