@toolpad/utils
Version:
Shared utilities used by Toolpad packages.
12 lines • 480 B
TypeScript
interface Handler<P extends unknown[]> {
(...params: P): void;
}
/**
* Creates a debounced version of the handler that is passed. The invocation of [fn] is
* delayed for [delay] milliseconds from the last invocation of the debounced function.
*
* This implementation adds on the lodash implementation in that it handles updates to the
* delay value.
*/
export default function useDebouncedHandler<P extends unknown[]>(fn: Handler<P>, delay: number): Handler<P>;
export {};