3.0.1 • Published 4 days ago

@svelte-put/intersect v3.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 days ago

@svelte-put/intersect

npm.badge bundlephobia.badge docs.badge repl.badge

Svelte action use:intersect - wrapper for IntersectionObserver

demo

svelte-put

This package is part of the @svelte-put family. For contributing guideline and more, refer to its readme.

Usage & Documentation

See the dedicated documentation page here.

Quick Start

<script lang="ts">
	import { intersect, type IntersectDetail } from '@svelte-put/intersect';
	function onIntersect(e: CustomEvent<IntersectDetail>) {
		const { observer, entries, direction } = e.detail;
		console.log('the observer itself', observer);
		console.log('scrolling direction:', direction);
		console.log('intersecting:', entries[0]?.isIntersecting ? 'entering' : 'leaving');
	}
</script>

<div use:intersect on:intersect="{onIntersect}" on:intersectonce />

Changelog

3.0.1

4 days ago

3.0.0

10 months ago

2.0.0

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.1

1 year ago

1.1.0

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago