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