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