vue-intersect
vue-intersect copied to clipboard
Lots of InteractionObservers
Hi!
Was just wondering about this component, when used on page with lots of things to observe, like an image gallery of similar, it would create am InteractionObserver for each usage instead of reusing a single observer.
Do you know if this would matter that much to performance or so ?
Perhaps if the observer options are the same, it could reuse it for multiple elements ?
@bobmoff, Yeah you're absolutely right. We might be better of having some sort of factory which creates Observes based on the configuration settings. This does however require some rewriting of the codebase and additional tests, but i think it's absolutely doable.
In my experience there is no direct performance implications when having multiple observes, but that of cause depends on the amount of observable elements that one might have.
I didn't hit any performance problems even when using thousands of intersection observers. It didn't show up in profiling at all.