We could probably try to integrate intersection observer and fallback to the original logic if the browser doesnt support it.
https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API
Also there is issue that currently the scroll event is attached on window, so it might cause issue if the we are using overflow scroll
Support
https://caniuse.com/#feat=intersectionobserver
How do you think?