Skip to content

Commit

Permalink
golf: assert against Map.get existence;
Browse files Browse the repository at this point in the history
- 880 gz / 717 br
  • Loading branch information
lukeed committed Dec 10, 2018
1 parent 47b370d commit 2cd1daf
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ const observer = new IntersectionObserver(entries => {
.filter(entry => entry.isIntersecting)
.forEach(entry => {
const url = entry.target.href;
if (!loaderFunctions.has(url)) {
return;
}
loaderFunctions.get(url).call(null);
const fn = loaderFunctions.get(url);
if (fn) fn.call(null);
});
});

Expand Down

0 comments on commit 2cd1daf

Please sign in to comment.