export type OnIntersectCancellation = ( ) => void ; export default function onIntersectChange ( el , callback , options ? ) { const observer = new IntersectionObserver ( ( entries ) => { callback ( entries [ 0 ] . isIntersecting ) ; } , options ) ; observer . observe ( el ) ; return ( ) => observer . disconnect ( ) ; }