requestAnimationFrame throttler
#238
iansan5653
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
A common throttling strategy for DOM queries is to use
requestAnimationFrameto avoid making calls more often than the document paints. This is especially useful for throttling handlers for scroll/resize, or for keeping track of style/position of elements.It would be great to have some kind of abstraction around
requestAnimationFrame. Of course this would be DOM-only; maybe in a new@tanstack/pacer-dompackage or something similar?All reactions