Manually starts a batch of updates without auto-flushing. Use batchFlush to finish the batch.
It is preferred to use the batch function instead.
A boolean indicating if this is the first batch trigger. If true, the caller should call batchFlush to finish the batch.
import { batchStart, batchFlush, writable, compute} from "@embra/reactivity";const count$ = writable(0);const double$ = compute(get => get(count$) * 2);const isFirst = batchStart();count$.set(1);count$.set(2);if (isFirst) { batchFlush();} Copy
import { batchStart, batchFlush, writable, compute} from "@embra/reactivity";const count$ = writable(0);const double$ = compute(get => get(count$) * 2);const isFirst = batchStart();count$.set(1);count$.set(2);if (isFirst) { batchFlush();}
Manually starts a batch of updates without auto-flushing. Use batchFlush to finish the batch.
It is preferred to use the batch function instead.