@ri7nz/rescript-intersection-observer

0.1.3 • Public • Published

rescript-intersection-observer

nearly zero-cost bind IntersectionObserver

Installation

Run the following in your favorit console:

> yarn add @ri7nz/rescript-intersection-observer

OR

> npm install --save @ri7nz/rescript-intersection-observer

Then, add @ri7nz/rescript-intersection-observer in your bsconfig.json:

-- "bs-dependencies": [],
++ "bs-dependencies": ["@ri7nz/rescript-intersection-observer"],

Usage

open Intersection

// construct
let observer = ObserverEntry.new(entries => {
  // implement your observe here
})

// observe
observer->Observer.observe(targetDOMElement)
// unobserve
observer->Observer.unobserve(targetDOMElement)

Or you can check this examples.

API

TODO: docs for API

  • Intersection.Observer
  • Intersection.ObserverEntry

Readme

Keywords

none

Package Sidebar

Install

npm i @ri7nz/rescript-intersection-observer

Weekly Downloads

2

Version

0.1.3

License

MIT

Unpacked Size

6.85 kB

Total Files

7

Last publish

Collaborators

  • ri7nz