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 3.0.0 to 3.0.1

12

lib/intersection.js

@@ -124,3 +124,7 @@ "use strict";

if (Array.isArray(_options.threshold)) {
if (isIntersecting !== undefined) {
// If isIntersecting is defined, use it to confirm the intersection.
// Firefox can report a negative intersectionRatio, but it will still have correctly set isIntersecting
_inView = isIntersecting;
} else if (Array.isArray(_options.threshold)) {
// If threshold is an array, check if any of them intersects. This just triggers the onChange event multiple times.

@@ -135,8 +139,2 @@ _inView = _options.threshold.some(function (threshold) {

if (isIntersecting !== undefined) {
// If isIntersecting is defined, ensure that the element is actually intersecting.
// Otherwise it reports a threshold of 0
_inView = _inView && isIntersecting;
}
// Update the visible value on the instance

@@ -143,0 +141,0 @@ instance.visible = _inView;

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

@@ -80,3 +80,3 @@ "main": "lib/index.js",

"eslint-config-insilico": "^5.0.1",
"flow-bin": "^0.61.0",
"flow-bin": "^0.62.0",
"flow-copy-source": "^1.2.1",

@@ -83,0 +83,0 @@ "husky": "^0.14.3",

@@ -127,3 +127,7 @@ // @flow

if (Array.isArray(options.threshold)) {
if (isIntersecting !== undefined) {
// If isIntersecting is defined, use it to confirm the intersection.
// Firefox can report a negative intersectionRatio, but it will still have correctly set isIntersecting
inView = isIntersecting
} else if (Array.isArray(options.threshold)) {
// If threshold is an array, check if any of them intersects. This just triggers the onChange event multiple times.

@@ -142,8 +146,2 @@ inView = options.threshold.some(threshold => {

if (isIntersecting !== undefined) {
// If isIntersecting is defined, ensure that the element is actually intersecting.
// Otherwise it reports a threshold of 0
inView = inView && isIntersecting
}
// Update the visible value on the instance

@@ -150,0 +148,0 @@ instance.visible = inView

Sorry, the diff of this file is not supported yet

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