1 min readMay 1, 2020
As you said, the difference is a large number of events registered in memory. Imagine the difference in larger dimensions like 2,000 elements etc. Moreover, based on the spec, the IntersectionObserver
is highly optimized so that it shouldn’t bother you. In addition to that, don’t forget that you also don’t create 700 instances of tippy
.
This technique can also be used with expensive operations that we can save when the element isn’t visible.