Skip to content

Commit 2cd1daf

Browse files
committed
golf: assert against Map.get existence;
- 880 gz / 717 br
1 parent 47b370d commit 2cd1daf

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/index.mjs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@ const observer = new IntersectionObserver(entries => {
2323
.filter(entry => entry.isIntersecting)
2424
.forEach(entry => {
2525
const url = entry.target.href;
26-
if (!loaderFunctions.has(url)) {
27-
return;
28-
}
29-
loaderFunctions.get(url).call(null);
26+
const fn = loaderFunctions.get(url);
27+
if (fn) fn.call(null);
3028
});
3129
});
3230

0 commit comments

Comments
 (0)