import{useState as e,useRef as r,useEffect as t}from"react";let useIntersectionObserver=(n={})=>{let[s,o]=e(!1),u=r(null);return t(()=>{let e=new IntersectionObserver(e=>{let[r]=e;r&&(r.isIntersecting?o(!0):o(!1))},{...n}),{current:r}=u;return r&&e.observe(r),()=>{r&&e.unobserve(r)}},[n]),[u,s]};export{useIntersectionObserver as default};
