Merge pull request #22111 from Algorithm5838/perf/debounce-get-contents

perf: use rAF to debounce getContents() during streaming
This commit is contained in:
Tim Baek
2026-03-02 01:28:15 +04:00
committed by GitHub
+6 -1
View File
@@ -964,7 +964,11 @@
};
$: if (history) {
getContents();
cancelAnimationFrame(contentsRAF);
contentsRAF = requestAnimationFrame(() => {
getContents();
contentsRAF = null;
});
} else {
artifactContents.set([]);
}
@@ -1294,6 +1298,7 @@
};
let scrollRAF = null;
let contentsRAF = null;
const scheduleScrollToBottom = () => {
if (!scrollRAF) {
scrollRAF = requestAnimationFrame(async () => {