You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The scroll event currently triggers a relatively expensive operation: attemptLoad, and thus, getCurrentDistance which uses getBoundingClientRect a couple of times that will require a recalculation of the layout of the DOM.
The number of calls to attemptLoad can be significantly reduced by using a simple debounced scrolling handler.
Without debounce (console.count() in attemptLoad()):
With debounce (timeout of 50ms):
The scope of change is very minor. Would a PR for this be acceptable?
The text was updated successfully, but these errors were encountered:
The scroll event currently triggers a relatively expensive operation:
attemptLoad
, and thus,getCurrentDistance
which usesgetBoundingClientRect
a couple of times that will require a recalculation of the layout of the DOM.The number of calls to
attemptLoad
can be significantly reduced by using a simple debounced scrolling handler.Without

debounce
(console.count()
inattemptLoad()
):With

debounce
(timeout of50ms
):The scope of change is very minor. Would a PR for this be acceptable?
The text was updated successfully, but these errors were encountered: