@embra/reactivity - v0.0.7
    Preparing search index...

    Function batchStart

    • Manually starts a batch of updates without auto-flushing. Use batchFlush to finish the batch.

      It is preferred to use the batch function instead.

      Returns boolean

      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();
      }