Uses IntersectionObserver to observe changes to nodes passed to the signal.
Param: source
Either a signal/observable/function that returns Elements or ElementRefs, or a value that is Elements or ElementRef.
If the source is a value then the signal will be writable.
Param: options
Options for the signal or the IntersectionObserver used to monitor changes.
Example
constel = document.getElementById('el1'); const$obs = intersectionSignal(el); effect(() =>console.log($obs()[0]?.attributeName)); // will log when scrolled into view. el.scrollIntoView();
Uses IntersectionObserver to observe changes to nodes passed to the signal.
Param: source
Either a signal/observable/function that returns Elements or ElementRefs, or a value that is Elements or ElementRef. If the source is a value then the signal will be writable.
Param: options
Options for the signal or the IntersectionObserver used to monitor changes.
Example