animare
Version:
Advanced animation library for modern JavaScript.
16 lines • 563 B
TypeScript
/**
* A game loop that executes a callback function on each animation frame.
*
* @param onUpdateCallback - The callback function to be executed on each animation frame. It receives the delta time since the last frame as a parameter.
* @returns A stop function that can be used to stop the loop.
*
* @example
* const stop = loop(delta => {
* // do something
* });
*
* stop(); // To stop the loop
*/
export default function loop(onUpdateCallback: (delta: number) => void): () => void;
export type Loop = typeof loop;
//# sourceMappingURL=loop.d.ts.map