Skip to content

react-query-firebase / firestore / useRunTransaction

Function: useRunTransaction()

ts
function useRunTransaction<AppModelType, TContext>(options): UseMutationResult<AppModelType, FirebaseError, UseRunTransactionValues, TContext>

Defined in: src/firestore/useRunTransaction.ts:20

Custom hook to execute a Firestore transaction using the useMutation hook.

Type Parameters

AppModelType = unknown

TContext = unknown

Parameters

options

UseRunTransactionOptions<AppModelType, TContext>

Configuration options for running the transaction.

Returns

UseMutationResult<AppModelType, FirebaseError, UseRunTransactionValues, TContext>

The result object from the useMutation hook, allowing to track the transaction state and outcome.

Released under the MIT License.