Utility to add functions to queues to tick using requestAnimationFrame
You can install via npm or yarn
npm install --save tick-manageryarn add tick-managerThere are 3 available queues to add tick functions too: Initial Ticks, Pre Ticks, and Ticks. The manager will run all this ticks in Initial Ticks first, followed by Pre Ticks, and then finally Ticks. This can be useful if you need to guarantee that one function runs before another that uses data from the first, but you can't guarantee what order AddTick will be called in each of those functions.
You can import the any of the three functions into your project using ES6 imports
import { AddInitialTick, AddPreTick, AddTick } from 'tick-manager';You can add a function to an array as follows (Note: The tick manager will begin running this function at the next animation frame and every one thereafter).
function myAmazingTickFunction() {
// do stuff
}
AddTick(myAmazingTickFunction);