diff --git a/dev/functions/batch.html b/dev/functions/batch.html index ba15ff4..01cb281 100644 --- a/dev/functions/batch.html +++ b/dev/functions/batch.html @@ -7,4 +7,4 @@
const r1 = reactive(1);
const r2 = reactive(2);
// Log r1 and r2 every time they change.
syncEffect(() => {
console.log(r1.value, r2.value);
});
// Trigger multiple updates at once.
batch(() => {
// these two updates don't trigger the effect yet
r1.value = 2;
r2.value = 3;
});
// now the effect runs once
-