feat(store): initial release (#279)

This commit is contained in:
rahim
2026-01-02 14:41:58 +11:00
committed by GitHub
parent c9a216dd2d
commit d74e4e6701
54 changed files with 6047 additions and 66 deletions
+20
View File
@@ -0,0 +1,20 @@
/**
* Request an animation frame and return a cleanup function to cancel it.
*
* @param callback - The callback to invoke on the next animation frame
* @returns A cleanup function that cancels the animation frame request
*
* @example
* ```ts
* const cancel = animationFrame((time) => {
* console.log('Frame at', time);
* });
*
* // Later, cancel if needed
* cancel();
* ```
*/
export function animationFrame(callback: FrameRequestCallback): () => void {
const id = requestAnimationFrame(callback);
return () => cancelAnimationFrame(id);
}