This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useCallback, useRef } from 'react' | |
/** | |
* A hook that returns a debounced version of the provided callback function | |
* @param callback The function to debounce | |
* @param delay The delay in milliseconds (default: 300ms) | |
* @returns A debounced version of the callback function | |
*/ | |
export function useDebounce<T extends (...args: any[]) => any>( | |
callback: T, |