Socket
Socket
Sign inDemoInstall

gatsby-image

Package Overview
Dependencies
Maintainers
2
Versions
310
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-image - npm Package Compare versions

Comparing version 1.0.24 to 1.0.25

31

index.js

@@ -68,20 +68,25 @@ "use strict";

var listeners = [];
if (typeof window !== "undefined" && window.IntersectionObserver) {
io = new window.IntersectionObserver(function (entries) {
entries.forEach(function (entry) {
listeners.forEach(function (l) {
if (l[0] === entry.target) {
// Edge doesn't currently support isIntersecting, so also test for an intersectionRatio > 0
if (entry.isIntersecting || entry.intersectionRatio > 0) {
io.unobserve(l[0]);
l[1]();
function getIO() {
if (typeof io === "undefined" && typeof window !== "undefined" && window.IntersectionObserver) {
io = new window.IntersectionObserver(function (entries) {
entries.forEach(function (entry) {
listeners.forEach(function (l) {
if (l[0] === entry.target) {
// Edge doesn't currently support isIntersecting, so also test for an intersectionRatio > 0
if (entry.isIntersecting || entry.intersectionRatio > 0) {
io.unobserve(l[0]);
l[1]();
}
}
}
});
});
});
}, { rootMargin: "200px" });
}, { rootMargin: "200px" });
}
return io;
}
var listenToIntersections = function listenToIntersections(el, cb) {
io.observe(el);
getIO().observe(el);
listeners.push([el, cb]);

@@ -88,0 +93,0 @@ };

{
"name": "gatsby-image",
"version": "1.0.24",
"version": "1.0.25",
"description": "Lazy-loading React image component with optional support for the blur-up effect.",

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

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