Skip to content

batch

Batches multiple state updates into a single notification.

import { batch } from '@reaxium/core';
function batch(fn: () => void): void
NameTypeDescription
fn() => voidFunction to execute in batch.
const a = atom(0);
const b = atom(0);
batch(() => {
a.set(1);
b.set(1);
});