@@ -35,12 +35,6 @@ export interface FirestoreRefOptions extends _DataSourceOptions {
3535 */
3636 maxRefDepth ?: number
3737
38- /**
39- * Should the data be fetched once rather than subscribing to changes.
40- * @experimental Still under development
41- */
42- once ?: boolean
43-
4438 /**
4539 * @inheritDoc {SnapshotOptions}
4640 */
@@ -61,7 +55,7 @@ export interface FirestoreRefOptions extends _DataSourceOptions {
6155 * Type of the global options for firestore refs. Some values cannot be `undefined`.
6256 * @internal
6357 */
64- interface _DefaultsFirestoreRefOptions extends FirestoreRefOptions {
58+ interface _FirestoreRefOptionsWithDefaults extends FirestoreRefOptions {
6559 /**
6660 * @defaultValue `false`
6761 */
@@ -82,7 +76,10 @@ interface _DefaultsFirestoreRefOptions extends FirestoreRefOptions {
8276 converter : FirestoreDataConverter < unknown >
8377}
8478
85- const DEFAULT_OPTIONS : _DefaultsFirestoreRefOptions = {
79+ /**
80+ * Global default options
81+ */
82+ const DEFAULT_OPTIONS : _FirestoreRefOptionsWithDefaults = {
8683 reset : false ,
8784 wait : true ,
8885 maxRefDepth : 2 ,
@@ -106,7 +103,7 @@ function unsubscribeAll(subs: Record<string, FirestoreSubscription>) {
106103}
107104
108105function updateDataFromDocumentSnapshot < T > (
109- options : _DefaultsFirestoreRefOptions ,
106+ options : _FirestoreRefOptionsWithDefaults ,
110107 target : Ref < T > ,
111108 path : string ,
112109 snapshot : DocumentSnapshot < T > ,
@@ -157,7 +154,7 @@ function subscribeToDocument(
157154 reject,
158155 ops,
159156 } : SubscribeToDocumentParameter ,
160- options : _DefaultsFirestoreRefOptions
157+ options : _FirestoreRefOptionsWithDefaults
161158) {
162159 const subs = Object . create ( null )
163160 let unbind = noop
@@ -213,7 +210,7 @@ function subscribeToDocument(
213210// first one is calling the other on every ref and subscribeToDocument may call
214211// updateDataFromDocumentSnapshot which may call subscribeToRefs as well
215212function subscribeToRefs (
216- options : _DefaultsFirestoreRefOptions ,
213+ options : _FirestoreRefOptionsWithDefaults ,
217214 target : Ref < unknown > ,
218215 path : string | number ,
219216 subs : Record < string , FirestoreSubscription > ,
0 commit comments