ra-core
Version:
Core components of react-admin, a frontend Framework for building admin applications on top of REST services, using ES6, React
14 lines • 735 B
text/typescript
export interface DebouncedEvent<Args extends unknown[], Return> {
(...args: Args): Return | undefined;
cancel: () => void;
flush: () => Return | undefined;
}
/**
* Hook somewhat equivalent to useEvent, but with a debounce
* Returns a debounced callback which will not change across re-renders unless the
* callback or delay changes
* @see https://reactjs.org/docs/hooks-faq.html#how-to-read-an-often-changing-value-from-usecallback
* @see https://github.com/facebook/react/issues/14099#issuecomment-440013892
*/
export declare const useDebouncedEvent: <Args extends unknown[], Return>(callback: (...args: Args) => Return, delay: number) => DebouncedEvent<Args, Return>;
//# sourceMappingURL=useDebouncedEvent.d.ts.map