signalizejs/intersection-observer
Observe changes in the element intersection with an ancestor element or with the document's viewport.
Installation
import Signalize from 'signalizejs';
const { observeIntersection } = await resolve('intersection-observer');
API
observeIntersection
Observe an element’s intersection and call a callback.
- options: For modifying intersection observer options.
const { observeIntersection } = signalize;
// Optional options
const options = {};
const observer = observeIntersection(document.querySelector('#element'), () => {
// Do something
}, options);