Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/nperez0111/bookhive. Track your books, share your shelves, see what others are reading bookhive.buzz
atproto bluesky books bookshelf goodreads management-system
Something went wrong. Try again.
400 B · 16 lines
TypeScript
1234567891011121314151617import { useEffect, useState } from "hono/jsx/dom";import { debounce } from "../../utils/debounce";
export function useDebounce<T>(value: T, delay: number): T { const [debouncedValue, setDebouncedValue] = useState<T>(value);
useEffect(() => { const handler = debounce(() => { setDebouncedValue(value); }, delay);
handler(); }, [value, delay]);
return debouncedValue;}