1
0
Fork 0
react-playground/node_modules/@mui/x-internals/esm/rafThrottle/rafThrottle.d.ts
Techognito fc0f69dacb Added Statistics calculation
Statistics now show calculated values
2025-09-04 17:30:00 +02:00

16 lines
No EOL
513 B
TypeScript

export interface Cancelable {
clear(): void;
}
/**
* Creates a throttled function that only invokes `fn` at most once per animation frame.
*
* @example
* ```ts
* const throttled = rafThrottle((value: number) => console.log(value));
* window.addEventListener('scroll', (e) => throttled(e.target.scrollTop));
* ```
*
* @param fn Callback function
* @return The `requestAnimationFrame` throttled function
*/
export declare function rafThrottle<T extends (...args: any[]) => any>(fn: T): T & Cancelable;