Socket
Socket
Sign inDemoInstall

svelte-lazy

Package Overview
Dependencies
21
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.1 to 1.2.2

20

index.js

@@ -1294,3 +1294,3 @@ (function (global, factory) {

const observer = observeNode(node, handler);
const observer = observeNode(node);

@@ -1309,6 +1309,9 @@ return {

const nodeTop = node.getBoundingClientRect().top;
const nodeBottom = node.getBoundingClientRect().bottom;
const expectedTop = getContainerHeight(e) + offset;
if (nodeTop <= expectedTop) {
loadNode(node, handler);
if (nodeTop <= expectedTop && nodeBottom > 0) {
loadNode(node);
} else {
unload(node);
}

@@ -1324,4 +1327,4 @@ },

const observer = new IntersectionObserver(entries => {
if (entries[0].intersectionRatio > 0) {
loadNode(node, handler);
if (entries[0].isIntersecting) {
loadNode(node);
observer.unobserve(entries[0].target);

@@ -1335,2 +1338,7 @@ }

function unload(node) {
setHeight(node);
$$invalidate(4, loaded = false);
}
function loadNode(node, handler) {

@@ -1347,4 +1355,2 @@ if (loaded) {

}
removeListeners(handler);
}

@@ -1351,0 +1357,0 @@

@@ -6,3 +6,3 @@ {

"main": "index.js",
"version": "1.2.1",
"version": "1.2.2",
"types": "index.d.ts",

@@ -30,3 +30,3 @@ "repository": "leafOfTree/svelte-lazy",

"peerDependencies": {
"svelte": "3.x"
"svelte": "^3.0.0 || ^4.0.0"
},

@@ -33,0 +33,0 @@ "keywords": [

@@ -115,3 +115,3 @@ <img src="https://raw.githubusercontent.com/leafOfTree/leafOfTree.github.io/master/svelte-lazy.svg" width="60" height="60" alt="icon" align="left"/>

[4]: https://www.npmjs.com/package/svelte-lazy
[5]: https://svelte.dev/repl/6d7714fa3cce4909af6c6d187271e0a1?version=3.6.10
[5]: https://svelte.dev/repl/6d7714fa3cce4909af6c6d187271e0a1
[6]: https://github.com/sveltejs/sapper-template#using-external-components

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc