Skip to content

Commit 1037e38

Browse files
committed
golf: inline isIntersecting filter;
- 875 gz / 720 br
1 parent 2cd1daf commit 1037e38

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/index.mjs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ import requestIdleCallback from './request-idle-callback.mjs';
1919

2020
const loaderFunctions = new Map();
2121
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-
});
22+
entries.forEach(entry => {
23+
if (entry.isIntersecting) {
24+
const url = entry.target.href;
25+
const fn = loaderFunctions.get(url);
26+
if (fn) fn.call(null);
27+
}
28+
});
2929
});
3030

3131
/**

0 commit comments

Comments
 (0)