A simple script with a few niceties that allows for multiple requestAnimationFrame
calls, and FPS pinning.
The script polyfills rAF if required, then overloads requestAnimationFrame
and cancelAnimationFrame
with a process that allows multiple frames to be queued up for rAF to run.
This is useful if there are multiple animations running on the page, you want all the callbacks to happen at once, and not on multiple rAF calls. This script is meant as a drop-in solution to that problem.