Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-intersection-observer

Package Overview
Dependencies
Maintainers
1
Versions
160
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-intersection-observer - npm Package Compare versions

Comparing version 0.2.8 to 0.2.9

10

lib/intersection.js

@@ -57,8 +57,12 @@ 'use strict';

var itemsLeft = INSTANCE_MAP.values().some(function (item) {
return item.threshold === instance.threshold;
// Check if we are stilling observing any elements with the same threshold.
var itemsLeft = false;
INSTANCE_MAP.forEach(function (item) {
if (item.threshold === instance.threshold) {
itemsLeft = true;
}
});
if (observerInstance && !itemsLeft) {
// No more elements to observe, disconnect
// No more elements to observe for threshold, disconnect observer
observerInstance.disconnect();

@@ -65,0 +69,0 @@ OBSERVER_MAP.delete(instance.threshold);

{
"name": "react-intersection-observer",
"version": "0.2.8",
"version": "0.2.9",
"description": "Monitor if a component is inside the viewport, using IntersectionObserver API",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -48,8 +48,12 @@ if (global.window && !process.env.SERVER) {

const itemsLeft = INSTANCE_MAP.values().some(
item => item.threshold === instance.threshold,
)
// Check if we are stilling observing any elements with the same threshold.
let itemsLeft = false
INSTANCE_MAP.forEach(item => {
if (item.threshold === instance.threshold) {
itemsLeft = true
}
})
if (observerInstance && !itemsLeft) {
// No more elements to observe, disconnect
// No more elements to observe for threshold, disconnect observer
observerInstance.disconnect()

@@ -56,0 +60,0 @@ OBSERVER_MAP.delete(instance.threshold)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc