Open mehulkar opened 4 years ago
Hey! Could you detail what you are thinking in this regards? I looked around and tried digging up some ideas - we don't initialize the raf-pool if the browser supports IObserver (thus no requestAnimationFrame). I'm sure I missed something though.
I was thinking this whole file: https://github.com/DockYard/ember-in-viewport/blob/master/addon/-private/raf-admin.js and the raf-pool
dependency could be changed to be dynamically imported, and only loaded if IntersectionObserver
is not defined. Not quite sure how/when that would happen.
That seems like an optimal idea! Although I think we would need to make the async chain all the way up to watchElement
...Certainly worth exploring but would be quite a big change.
It would be nice if the rAF implementation was not loaded if the browser supports
IntersectionObserver
.