Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
13 lines
703 B
Plaintext
13 lines
703 B
Plaintext
export declare const THROTTLED = "__THROTTLED";
|
|
export declare const SKIPPED = "__SKIPPED";
|
|
/**
|
|
* Create a throttled function off a given function.
|
|
* When calling the throttled function, it will call the original function only
|
|
* if it hasn't been called more than `maxCount` times in the last `durationSeconds`.
|
|
*
|
|
* Returns `THROTTLED` if throttled for the first time, after that `SKIPPED`,
|
|
* or else the return value of the original function.
|
|
*/
|
|
export declare function throttle<T extends (...rest: any[]) => any>(fn: T, maxCount: number, durationSeconds: number): (...rest: Parameters<T>) => ReturnType<T> | typeof THROTTLED | typeof SKIPPED;
|
|
//# sourceMappingURL=throttle.d.ts.map
|