ApoorvSaxena / ApoorvSaxena/lozad.js
Elements aren't Unobserved if Loaded via triggerLoad
Aperta
enhancement
Hacktoberfest
- Lingua principale
- JavaScript
- Stelle
- 7.5k
- Fork
- 435
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
I noticed that the triggerLoad function currently does not unobserve elements, so an unnecessary onIntersection can still happen that will return immediately due to the isLoaded check. I had the idea in my fork to instead of just adding observer.unobserve(element) in triggerLoad to also have the onIntersection and observe methods call triggerLoad instead of duplicating the code from triggerLoad. Would this be a sane change?
https://github.com/TiKevin83/lozad.js/commit/97e02bed37d0185eaccad9883a4d09c57f9f9604
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.