Mikescops / vue-virtual-grid

🖼️ Vue Virtual Grid Rendering
https://www.npmjs.com/package/vue-virtual-grid
MIT License
53 stars 16 forks source link

reason to not use IntersectionObserver #19

Closed mesqueeb closed 3 years ago

mesqueeb commented 3 years ago

I thought it was quite interesting reading your source code. You do not rely on IntersectionObserver.

I was wondering what your thought process was creating this component and if you considered APIs like the IntersectionObserver or not, and for what reasons?

Cheers!

Mikescops commented 3 years ago

Hello @mesqueeb ,

Thanks for asking :+1:

My initial goal was to make the fastest gallery of images possible. Of course I tried to use the IntersectionObserver, but when it comes to handling hundred to thousands elements the performances where decreasing drastically.

In this component, I just use some simple maths that doesn't block rendering for long.