Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/sixty-tables-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

fix: respect the unidirectional nature of time
7 changes: 5 additions & 2 deletions packages/svelte/src/internal/client/loop.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ import { raf } from './timing.js';
// TODO move this into timing.js where it probably belongs

/**
* @param {number} now
* @returns {void}
*/
function run_tasks(now) {
function run_tasks() {
// use `raf.now()` instead of the `requestAnimationFrame` callback argument, because
// otherwise things can get wonky https://github.com/sveltejs/svelte/pull/14541
const now = raf.now();

raf.tasks.forEach((task) => {
if (!task.c(now)) {
raf.tasks.delete(task);
Expand Down
Loading