Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
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.
Note: A companion library is also available for requestAnimationFrame: https://github.com/snewcomer/raf-pool
npm install intersection-observer-admin --save
import IntersectionObserverAdmin from 'intersection-observer-admin';
const intersectionObserverAdmin = new IntersectionObserverAdmin();
// Add callbacks that will be called when observer detects entering and leaving viewport
intersectionObserverAdmin.addEnterCallback(element, enterCallback);
intersectionObserverAdmin.addExitCallback(element, exitCallback);
// add an element to static administrator with window as scrollable area
intersectionObserverAdmin.observe(element, { root, rootMargin: '0px 0px 100px 0px', threshold: 0 });
// add an element in a scrolling container
intersectionObserverAdmin.observe(element, { root, rootMargin: '0px 0px 100px 0px', threshold: 0 });
// Use in cleanup lifecycle hooks (if applicable) from the element being observed
intersectionObserverAdmin.unobserve(element, observerOptions);
// 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 | 12.1 |
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 31,852 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.