ng-defer-load icon indicating copy to clipboard operation
ng-defer-load copied to clipboard

Performance Improvements - Reuse same IntersectionObserver as suggested in docs

Open naveedahmed1 opened this issue 5 years ago • 1 comments

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?

naveedahmed1 avatar Sep 30 '19 21:09 naveedahmed1

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

mzoellner avatar Jun 30 '20 06:06 mzoellner