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.

const { observeIntersection } = signalize;

// Optional options
const options = {};

const observer = observeIntersection(document.querySelector('#element'), () => {
	// Do something
}, options);