This adds a batchedEffect(cb) utility that synchronously runs its callback when dependencies are updated inside a batch() call.
const a = new Signal.State(0);
const b = new Signal.State(0);
batchedEffect(() => {
console.log("a + b =", a.get() + b.get());
});
// Logs: a + b = 0
batch(() => {
a.set(1);
b.set(1);
});
// Logs: a + b = 2
This adds a
batchedEffect(cb)
utility that synchronously runs its callback when dependencies are updated inside abatch()
call.