• Combine multiple value updates into one "commit" at the end of the provided callback.

    Batches can be nested and changes are only flushed once the outermost batch callback completes.

    Accessing a signal that has been modified within a batch will reflect its updated value.

    Type Parameters

    • T

    Parameters

    • fn: (() => T)

      The callback function.

        • (): T
        • Returns T

    Returns T

    The value returned by the callback.