Skip to main content
Version: Next

withStorageTransaction

Callable

  • withStorageTransaction<T>(callback, options): Promise<T>

  • Runs callback inside a new StorageTransaction: storage writes made in the callback are committed when it returns and rolled back when it throws. If a transaction is already active in the current async context, it is reused and its outcome is left to its owner (and options are ignored) — there are no nested transaction semantics.


    Parameters

    Returns Promise<T>