From 0fa10ad3cb2a72bec19830f5bc7dd6e3a062e3e0 Mon Sep 17 00:00:00 2001 From: "jude.kwashie" Date: Fri, 28 Feb 2025 16:09:14 +0000 Subject: [PATCH] chore(firestore): add support for onSnapshotsInSync --- packages/firestore/lib/modular/snapshot.d.ts | 10 ++++++++++ packages/firestore/lib/modular/snapshot.js | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/packages/firestore/lib/modular/snapshot.d.ts b/packages/firestore/lib/modular/snapshot.d.ts index 38384a5252..bdb6f267a5 100644 --- a/packages/firestore/lib/modular/snapshot.d.ts +++ b/packages/firestore/lib/modular/snapshot.d.ts @@ -227,3 +227,13 @@ export declare function queryEqual, right: Query, ): boolean; + +/** + * Attaches a listener for a snapshots-in-sync event. + * The snapshots-in-sync event indicates that all listeners affected by a given change have fired, even if + * a single server-generated change affects multiple listeners. + * + * @param firestore + * @param onSync + */ +export declare function onSnapshotsInSync(firestore: Firestore, onSync: () => void): Unsubscribe; \ No newline at end of file diff --git a/packages/firestore/lib/modular/snapshot.js b/packages/firestore/lib/modular/snapshot.js index 946f1c819d..21805eab53 100644 --- a/packages/firestore/lib/modular/snapshot.js +++ b/packages/firestore/lib/modular/snapshot.js @@ -18,3 +18,8 @@ export function onSnapshot(reference, ...args) { export function snapshotEqual(left, right) { return left.isEqual.call(left, right, MODULAR_DEPRECATION_ARG); } + + +export function onSnapshotsInSync(firestore, ...args) { + return firestore.onSnapshotsInSync.call(firestore, ...args, MODULAR_DEPRECATION_ARG); +} \ No newline at end of file