question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unobserve prefetched elements

See original GitHub issue

Depending on the number of links on a page, or if new links are added programmatically after the initial call. Both the query selector in the timeout method https://github.com/GoogleChromeLabs/quicklink/blob/master/src/index.mjs#L70, and/or the entries loop in the observer callback https://github.com/GoogleChromeLabs/quicklink/blob/master/src/index.mjs#L23, could be problematic for subsequent calls.

I think it would be worth to unobserve elements that are already prefetched.

Additionally, instead of requiring additional calls to quicklink({ urls: [..]}), which I think it is still needed to override the intersection observer; a mutationobserver.mjs could be enabled through an option, or to keep the lib size down, expose it in dist and allow its default export to be passed as an option for runtime.

Let me know what you think and I can tackle these. 👍 Thanks!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
lukeedcommented, Dec 17, 2018

Perhaps we should rename this issue to reflect infinite scroll support? Now that quicklink is now technically unobserving processed elements, this issue has sparked a larger feature.

0reactions
lfrecommented, Dec 17, 2018

Thanks, @lukeed @addyosmani! I split the specific issue here. Apologies for lumping them together, infinite scroll is where the issue was most noticeable.

Closing this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IntersectionObserver.unobserve() - Web APIs | MDN
The IntersectionObserver method unobserve() instructs the IntersectionObserver to stop observing the specified target element.
Read more >
I-SPY: Context-Driven Conditional Instruction Prefetching with ...
Two key techniques underlie I-. SPY's design: (1) conditional prefetching, which only prefetches instructions if the program context is known to lead to...
Read more >
A Survey on Recent Hardware Data Prefetching Approaches ...
Data prefetching, i.e., the act of predicting application's future memory accesses and fetching those that are not in the on-chip caches, ...
Read more >
PTX ISA :: CUDA Toolkit Documentation
The programming guide to using PTX (Parallel Thread Execution) and ISA (Instruction Set Architecture).
Read more >
DMon: Efficient Detection and Correction of Data Locality ...
Prefetching the elements of b requires accessing the elements of a. ... data locality for unobserved inputs of several other bench-.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found