We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
isIntersecting
1 parent 2cd1daf commit 1037e38Copy full SHA for 1037e38
1 file changed
src/index.mjs
@@ -19,13 +19,13 @@ import requestIdleCallback from './request-idle-callback.mjs';
19
20
const loaderFunctions = new Map();
21
const observer = new IntersectionObserver(entries => {
22
- entries
23
- .filter(entry => entry.isIntersecting)
24
- .forEach(entry => {
25
- const url = entry.target.href;
26
- const fn = loaderFunctions.get(url);
27
- if (fn) fn.call(null);
28
- });
+ entries.forEach(entry => {
+ if (entry.isIntersecting) {
+ const url = entry.target.href;
+ const fn = loaderFunctions.get(url);
+ if (fn) fn.call(null);
+ }
+ });
29
});
30
31
/**
0 commit comments