Easily integrate the Intersection Observer API in Svelte
npm install svelte-intersection-api-action
<script>
import { intersectionAPI } from "svelte-intersection-api-action";
</script>
<div use:intersectionAPI={{ options }} on:crossed={(e)=>doSomething(e.detail)}>
</div>
options
: The options used by the Intersection Observer API
e.detail
: An IntersectionObserverEntry, is dispatched when a threshold is crossed
Distributed under the MIT License.