/** * __useDebounce__ * * This hook lets you react to values that change a lot, without having * to react on every single change an example of this would be a search input: * You want to input to be applied instantly to avoid laggy UX, and you want to * apply the search filtering after a debounced delay. * * You can do this by tracking 2 states: * * @example * ``` * // changes in query can trigger a heavy filtering operation * const [query, setQuery] = useState(''); * // inputValue changes on every keystroke * const [inputValue, setInput] = useState(''); * * useDebounce(() => setQuery(inputValue), 200, [inputValue]); * * // filter your data based on "query" * ``` * * @param debounced debounced function that wil be run when the deps change * @param ms ms of delay you want to debounce the function * @param deps array of values that you want to react to when they change */ declare const useDebounce: (debounced: Function, ms: number, deps: Array) => void; export default useDebounce;