4 ms·
As long as you're throttling, there's nothing wrong with interfacing with onScroll. I use it for all sorts of things. Scroll-jacking is the real issue.
by kakarot 8y ago
As long as you're throttling, there's nothing wrong with interfacing with onScroll. I use it for all sorts of things. Scroll-jacking is the real issue.
- acdha 8y agoShouldn't most of those be using Intersection Observers these days? That should avoid most of the cases where someone unintentionally breaks the user experience.
- antibland 8y agoYes, and another bonus is that Intersection Observer is asynchronous and eliminates the need to tack on an additional debounce function.
- kakarot 8y agoNot yet, but soon: https://caniuse.com/#feat=intersectionobserver https://caniuse.com/#feat=intersectionobserver
- acdha 8y agoGood point: I’ve been using it with polyfills which tends to hit the same point of not using an API which encourages accidental jank but it’s no substitute for native support.
- kakarot 8y agoI am looking forward to switching over. Currently, I try to pool callbacks onto the same onScroll event when I can but it's still janky.