createIntersection(
config?):object
Create an intersection service.
The returned service includes the patch method to set the elements to observe / intersection options and the states to track the visible elements.
PropsConfig<IntersectionProps>
the props config for the intersection service
object
the intersection service
elements$:
ReadableSignal<HTMLElement[]>
patch: (
storesValues) =>void
void
visibleElements$:
ReadableSignal<Map<Element,IntersectionObserverEntry>>
Interface representing the properties for the Intersection service.
elements:
HTMLElement[]
elements to observe
options:
undefined|Partial<IntersectionObserverInit>
IntersectionObserverInit used in the IntersectionObserver