feat: похуйу

This commit is contained in:
2026-05-12 23:14:45 +03:00
parent 2bea3f5eea
commit 35e537933e
8 changed files with 115 additions and 29 deletions

View File

@@ -0,0 +1,12 @@
import { useEffect, useState } from 'react'
export function useDebounce<T>(value: T, delay: number): T {
const [debounced, setDebounced] = useState(value)
useEffect(() => {
const id = setTimeout(() => setDebounced(value), delay)
return () => clearTimeout(id)
}, [value, delay])
return debounced
}