Various optimizations

This commit is contained in:
Jon Staab
2026-02-05 17:48:29 -08:00
parent d2756ead28
commit 99c1d09b62
9 changed files with 77 additions and 52 deletions
+1 -3
View File
@@ -1257,11 +1257,9 @@ export const batch = <T>(t: number, f: (xs: T[]) => void) => {
}
return (x: T) => {
const shouldFlush = timeoutId === undefined
xs.push(x)
if (shouldFlush) {
if (!timeoutId) {
f(xs.splice(0))
timeoutId = setTimeout(later, t)
}