Security News
Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
intersection-observer-admin
Advanced tools
Readme
This library is used in ember-in-viewport and ember-infinity. This library is particularly important for re-using the IntersectionObserver API.
Most implementations have one Intersection Observer for each target element or so called sentinel
. However, IntersectionObserver.observe can observer multiple sentinels
. So this library will resuse the IntersectionObserver instance for another element on the page with the same set of observer options and root element. This can dramatically improve performance for pages with lots of elements and observers.
npm install intersection-observer-admin --save
import IntersectionObserverAdmin from 'intersection-observer-admin';
const intersectionObserverAdmin = new IntersectionObserver();
// add an element to static administrator
intersectionObserverAdmin.observe(element, enterCallback, exitCallback, { root, rootMargin: '0px 0px 100px 0px', threshold: 0 });
// add an element in a scrolling container
intersectionObserverAdmin.add(element, enterCallback, exitCallback, { root, rootMargin: '0px 0px 100px 0px', threshold: 0 }, '.my-list');
// Use in cleanup lifecycle hooks (if applicable) from the element being observed
intersectionObserverAdmin.unobserve(element, observerOptions, scrollableArea);
// Use in cleanup lifecycle hooks of your application as a whole
// This will remove the in memory data store holding onto all of the observers
intersectionObserverAdmin.destroy();
Chrome | 51 [1] |
Firefox (Gecko) | 55 [2] |
MS Edge | 15 |
Internet Explorer | Not supported |
Opera [1] | 38 |
Safari | Safari Technology Preview |
Chrome for Android | 59 |
Android Browser | 56 |
Opera Mobile | 37 |
isIntersecting
until later versions.dom.IntersectionObserver.enabled
.FAQs
Intersection Observer Admin for better performance
The npm package intersection-observer-admin receives a total of 23,336 weekly downloads. As such, intersection-observer-admin popularity was classified as popular.
We found that intersection-observer-admin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.