Stop using scroll events for visibility detection. Intersection Observer is performant, non-blocking, and runs on a separate thread.
Basic Usage
Lazy Loading Images
Infinite Scroll
Scroll-Triggered Animations
Performance Advantage
Unlike scroll event listeners, Intersection Observer runs asynchronously and doesn't block the main thread. No need for throttle/debounce.