Skip to content

react-query-firebase / firestore / useBatchWrite

Function: useBatchWrite()

ts
function useBatchWrite<TContext>(options): UseMutationResult<void, FirebaseError, UseBatchWriteVariables, TContext>

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

Custom hook to perform batch write operations using Firestore. Utilizes a mutation to carry out the batch write transaction.

Type Parameters

TContext = unknown

The type of context that can be passed into the hook, defaults to unknown.

Parameters

options

UseBatchWriteOptions<TContext> = {}

The configuration options for the mutation operation.

Returns

UseMutationResult<void, FirebaseError, UseBatchWriteVariables, TContext>

Returns an object composed of elements returned by useMutation, including properties such as status, and functions to trigger and control the mutation process.

Released under the MIT License.