diff --git a/.changeset/slimy-mails-trade.md b/.changeset/slimy-mails-trade.md new file mode 100644 index 00000000..6fee50cb --- /dev/null +++ b/.changeset/slimy-mails-trade.md @@ -0,0 +1,5 @@ +--- +"runed": patch +--- + +fix: `AnimationFrames` diff --git a/packages/runed/src/lib/utilities/AnimationFrames/AnimationFrames.svelte.ts b/packages/runed/src/lib/utilities/AnimationFrames/AnimationFrames.svelte.ts index e03d9456..cb73a1df 100644 --- a/packages/runed/src/lib/utilities/AnimationFrames/AnimationFrames.svelte.ts +++ b/packages/runed/src/lib/utilities/AnimationFrames/AnimationFrames.svelte.ts @@ -60,7 +60,7 @@ export class AnimationFrames { }); } - #loop(timestamp: DOMHighResTimeStamp): void { + #loop = (timestamp: DOMHighResTimeStamp): void => { if (!this.#running) return; if (this.#previousTimestamp === null) { @@ -78,7 +78,7 @@ export class AnimationFrames { this.#previousTimestamp = timestamp; this.#callback({ delta, timestamp }); this.#frame = requestAnimationFrame(this.#loop); - } + }; start(): void { this.#running = true;