intersect.svelte.ts view source
DisconnectState intersecting
booleanintersections
numberel
HTMLElement | SVGElementobserver
IntersectionObserver7 declarations
intersect.svelte.ts view source
DisconnectState intersectingbooleanintersectionsnumberelHTMLElement | SVGElementobserverIntersectionObserverintersect.svelte.ts view source
(get_params: () => IntersectParamsOrCallback | null | undefined): Attachment<HTMLElement | SVGElement> Creates an attachment that observes element viewport intersection. Uses the lazy function pattern to optimize reactivity: callbacks can update without recreating the observer, preserving state.
get_paramsFunction that returns callback, params object, or nullish to disable
() => IntersectParamsOrCallback | null | undefinedAttachment<HTMLElement | SVGElement> intersect.svelte.ts view source
IntersectParams onintersectCalled when the element enters or leaves the viewport until disconnected.
ondisconnectCalled when the attachment's observer is disconnected, either by the user calling disconnect or the attachment being destroyed.
countA value of 1 disconnects after el enters and leaves the viewport one time,
similar to 'once' for an event.
0 disables and undefined or a negative number like -1 never disconnects.
numberoptionsSame as the options param to
IntersectionObserver
IntersectionObserverInitintersect.svelte.ts view source
IntersectParamsOrCallback intersect.svelte.ts view source
IntersectState intersectingbooleanintersectionsnumberelHTMLElement | SVGElementobserverIntersectionObserverdisconnect() => voidintersect.svelte.ts view source
OnDisconnect intersect.svelte.ts view source
OnIntersect