@thibault.sh/hooks
Version:
A comprehensive collection of React hooks for browser storage, UI interactions, and more
2 lines • 318 B
JavaScript
import {useRef,useEffect}from'react';function i(t,r){let e=useRef(t);useEffect(()=>{e.current=t;},[t]),useEffect(()=>{if(r===null)return;let u=setInterval(()=>{e.current();},r);return ()=>clearInterval(u)},[r]);}export{i as useInterval};//# sourceMappingURL=useInterval.mjs.map
//# sourceMappingURL=useInterval.mjs.map