requestidlecallback

scroll events: requestAnimationFrame VS requestIdleCallback VS passive event listeners

不问归期 提交于 2019-11-29 18:47:38
As we know, it's often advised to debounce scroll listeners so that UX is better when the user is scrolling. However, I've often found libraries and articles where influential people like Paul Lewis recommend using requestAnimationFrame . However as the web platform progress rapidly, it might be possible that some advice get deprecated over time. The problem I see is there are very different use-cases for handling scroll events, like building a parallax website, or handling infinite scrolling and pagination. I see 3 major tools that can make a difference in term of UX: requestAnimationFrame

scroll events: requestAnimationFrame VS requestIdleCallback VS passive event listeners

只愿长相守 提交于 2019-11-28 13:40:14
问题 As we know, it's often advised to debounce scroll listeners so that UX is better when the user is scrolling. However, I've often found libraries and articles where influential people like Paul Lewis recommend using requestAnimationFrame . However as the web platform progress rapidly, it might be possible that some advice get deprecated over time. The problem I see is there are very different use-cases for handling scroll events, like building a parallax website, or handling infinite scrolling