Deprecated
useDebounce uses a naive setTimeout implementation and will be removed. For a more robust implementation, use useDebounceCallback for functions and useDebounceValue for primitive values instead. The new implementation uses lodash.debounce under the hood.
import { useDebounce } from "https://deno.land/x/netzo@0.5.70/deps/usehooks-ts.ts";
Custom hook for debouncing a value.
Examples
const debouncedSearchTerm = useDebounce(searchTerm, 300);
const debouncedSearchTerm = useDebounce(searchTerm, 300);
Parameters
value: T
- The value to be debounced.