0.1.3 • Published 4 years ago
@ri7nz/rescript-intersection-observer v0.1.3
rescript-intersection-observer
nearly zero-cost bind IntersectionObserver
Installation
Run the following in your favorit console:
> yarn add @ri7nz/rescript-intersection-observerOR
> npm install --save @ri7nz/rescript-intersection-observerThen, 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