Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance Improvements - Reuse same IntersectionObserver as suggested in docs #33

Open
naveedahmed1 opened this issue Sep 30, 2019 · 1 comment

Comments

@naveedahmed1
Copy link

Google Developer docs available at https://developers.google.com/web/updates/2016/04/intersectionobserver
suggests:

If you need to observe multiple elements, it is both possible and advised to observe multiple elements using the same IntersectionObserver instance by calling observe() multiple times

It seems that this directive creates new IntersectionObserver for each element, so if there are let;s say 20 images we will end up with 20 IntersectionObservers. What if we could re-use the same IntersectionObserver?

@mzoellner
Copy link
Contributor

Hi @naveedahmed1,
that's a great suggestion.
Would you mind creating a PR for it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants