setTransactionData
setTransactionData(
key,value):void
Defined in: .work/repos/olmdb/src/olmdb.ts:126
Attach some arbitrary user data to the current transaction context, which is attached to the currently running (async) task.
Parameters
Section titled “Parameters”symbol
A symbol key to store data in the current transaction context.
any
The value to store.
Returns
Section titled “Returns”void
Throws
Section titled “Throws”If called outside of a transaction context.
Example
Section titled “Example”const MY_SYMBOL = Symbol("myKey");await transact(async () => { setTransactionData(MY_SYMBOL, "myValue"); await somethingAsync(); // Can be interleaved with other transactions const value = getTransactionData(MY_SYMBOL); console.log(value); // "myValue"});