useDebounce
Delay updates to a value until it has stopped changing.
useDebounce.tsx
import { useDebounce } from "@cermuel/hooks/react";import { useState } from "react";export function UseDebounceExample() { const [query, setQuery] = useState(""); const debouncedQuery = useDebounce(query, 300); return ( <label> Search <input value={query} onChange={(event) => setQuery(event.target.value)} /> <span>Debounced value: {debouncedQuery}</span> </label> );}Props
Param
Type
Default Value
valueTdelay?number250Returns
T