Skip to content

Commit ae85a41

Browse files
committed
feat(firestore): default serverTimestamps to estimate
1 parent 5ecbae0 commit ae85a41

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/firestore/bind.ts

+6
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ interface _FirestoreRefOptionsWithDefaults extends FirestoreRefOptions {
7575
* See https://vuefire.vuejs.org/guide/global-options.html
7676
*/
7777
converter: FirestoreDataConverter<unknown>
78+
79+
/**
80+
* @defaultValue `{ serverTimestamps: 'estimate' }` to avoid `null` values
81+
*/
82+
snapshotOptions: SnapshotOptions
7883
}
7984

8085
/**
@@ -85,6 +90,7 @@ const DEFAULT_OPTIONS: _FirestoreRefOptionsWithDefaults = {
8590
wait: true,
8691
maxRefDepth: 2,
8792
converter: firestoreDefaultConverter,
93+
snapshotOptions: { serverTimestamps: 'estimate' },
8894
}
8995
export { DEFAULT_OPTIONS as firestoreOptionsDefaults }
9096

0 commit comments

Comments
 (0)