UNPKG

react-box-tools

Version:

Box tools react components, utils and hooks

13 lines (12 loc) 236 B
import { useRef as o } from "react"; const c = (t, r) => { const e = o(null); return (...u) => { e.current && clearTimeout(e.current), e.current = setTimeout(() => { t(...u); }, r ?? 500); }; }; export { c as u };