observer / src /lib /useTimeout.ts
jbilcke-hf's picture
jbilcke-hf HF staff
fixed some issues
1896b82
raw
history blame contribute delete
191 Bytes
import { useEffect } from "react"
export function useTimeout(duration: number, callback: () => void) {
useEffect(() => {
setTimeout(() => {
callback()
}, duration)
}, [])
}