The Firebase JS SDK is now in BETA!
This EAP site is no longer maintained. See the official Firebase Documentation site for the latest documentation and information about the Firebase JS SDK.

Home > @firebase/firestore > / > waitForPendingWrites

waitForPendingWrites() function

Waits until all currently pending writes for the active user have been acknowledged by the backend.

The returned Promise resolves immediately if there are no outstanding writes. Otherwise, the Promise waits for all previously issued writes (including those written in a previous app session), but it does not wait for writes that were added after the function is called. If you want to wait for additional writes, call waitForPendingWrites() again.

Any outstanding waitForPendingWrites() Promises are rejected during user changes.

Signature:

export declare function waitForPendingWrites(firestore: FirebaseFirestore): Promise<void>;

Parameters

Parameter Type Description
firestore FirebaseFirestore

Returns:

Promise<void>

A Promise which resolves when all currently pending writes have been acknowledged by the backend.