initial commit

This commit is contained in:
developer committed 2026-09-27 11:20:34 +00:00
1 parent 5b935301e5
commit 85453852d5
105 files changed
+24846

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
import { useEffect, useState } from 'react'
/**
* Trails `value` by `ms`. Used by the search boxes so typing does not fire a
* request per keystroke.
*/
export function useDebounced<T>(value: T, ms: number): T {
const [debounced, setDebounced] = useState(value)
useEffect(() => {
if (ms <= 0) {
setDebounced(value)
return
}
const timer = setTimeout(() => setDebounced(value), ms)
return () => clearTimeout(timer)
}, [value, ms])
return debounced
}