import { useEffect } from "react";
const useIntersectionObserver = (ref, callback, options) => {
	useEffect(() => {
		const intersectionObserver = new IntersectionObserver(callback, options);
		if (ref?.current) intersectionObserver.observe(ref.current);
		return () => {
			if (ref?.current) intersectionObserver.unobserve(ref.current);
			else intersectionObserver.disconnect();
		};
	}, [ref, options]);
};
export { useIntersectionObserver as t };

//# sourceMappingURL=useIntersectionObserver.js.map