Using requestAnimationFrame here is brilliant for mobile devices. We used to hit serious UI stutters on low-end Android viewports because third-party state managers were choking the main thread. Capping the localized queue size is definitely the right move to prevent memory leaks.