We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Array.from
1 parent 9056abe commit 5def7ddCopy full SHA for 5def7dd
1 file changed
src/index.mjs
@@ -62,9 +62,10 @@ export default function (options) {
62
}
63
64
// If not, find all links and use IntersectionObserver.
65
- const linkTags = Array.from(options.el.querySelectorAll('a'));
66
- linkTags.forEach(link => observer.observe(link));
67
- const urls = linkTags.map(link => link.href);
+ const urls = Array.from(options.el.querySelectorAll('a'), link => {
+ observer.observe(link);
+ return link.href;
68
+ });
69
70
// Generate loader functions for each link
71
urls.forEach(url => {
0 commit comments