svelte-intersection-api-action

0.0.3 • Public • Published

Svelte Intersection Observer Action

Easily integrate the Intersection Observer API in Svelte

See the demo

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.

Package Sidebar

Install

npm i svelte-intersection-api-action

Weekly Downloads

0

Version

0.0.3

License

MIT

Unpacked Size

3.06 kB

Total Files

4

Last publish

Collaborators

  • anotherempty