diff --git a/src/index.mjs b/src/index.mjs index 5c3e1a29..338e2493 100644 --- a/src/index.mjs +++ b/src/index.mjs @@ -19,13 +19,13 @@ import requestIdleCallback from './request-idle-callback.mjs'; const loaderFunctions = new Map(); const observer = new IntersectionObserver(entries => { - entries - .filter(entry => entry.isIntersecting) - .forEach(entry => { - const url = entry.target.href; - const fn = loaderFunctions.get(url); - if (fn) fn.call(null); - }); + entries.forEach(entry => { + if (entry.isIntersecting) { + const url = entry.target.href; + const fn = loaderFunctions.get(url); + if (fn) fn.call(null); + } + }); }); /**