We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 11c4369 commit 47b370dCopy full SHA for 47b370d
1 file changed
src/index.mjs
@@ -59,17 +59,15 @@ export default function (options) {
59
}
60
61
// If not, find all links and use IntersectionObserver.
62
- const urls = Array.from(options.el.querySelectorAll('a'), link => {
+ Array.from(options.el.querySelectorAll('a'), link => {
63
observer.observe(link);
64
- return link.href;
65
- });
66
67
- // Generate loader functions for each link
68
- urls.forEach(url => {
69
- loaderFunctions.set(url, () => {
70
- loaderFunctions.delete(url);
71
- prefetch(url, options.priority);
72
+ // Generate loader functions for each link
+ const uri = link.href;
+ loaderFunctions.set(uri, () => {
+ loaderFunctions.delete(uri);
+ prefetch(uri, options.priority);
+ });
73
});
74
}, {timeout: options.timeout});
75
0 commit comments