本页还没有译文
本页 7 段还没译成Русский,下面显示的是英文原文。getActiveTransaction
还没翻译译自英文(tanstack.com)本页 7 段都还没译
function getActiveTransaction():
| Transaction<Record<string, unknown>>
| undefined;Defined in: packages/db/src/transactions.ts:361
Gets the currently active ambient transaction, if any Used internally by collection operations to join existing transactions
Returns
| Transaction<Record<string, unknown>>
| undefined
The active transaction or undefined if none is active
Example
// Check if operations will join an ambient transaction
const ambientTx = getActiveTransaction()
if (ambientTx) {
console.log('Operations will join transaction:', ambientTx.id)
}AI 翻译查看英文原文