2 lines
447 B
Java
2 lines
447 B
Java
import{w as c,r as a}from"./vue-vendor-DNhG1Cve.js";function i({target:n,root:u,onIntersect:l,rootMargin:o="0px",threshold:t=.1}){let r=()=>{};const e=a(null),v=c(()=>{r(),e.value=new IntersectionObserver(l,{root:u?u.value:null,rootMargin:o,threshold:t});const s=n.value;s&&e.value.observe(s),r=()=>{e.value&&(e.value.disconnect(),n.value&&e.value.unobserve(n.value))}});return{observer:e,stop:()=>{r(),v()}}}export{i as useIntersectionObserver};
|