(ref: DocumentReference<T>, options?: ReactFireOptions<T>)
| 72 | * Get a Firestore document, unwrap the document into a plain object, and don't subscribe to changes |
| 73 | */ |
| 74 | export function useFirestoreDocDataOnce<T = unknown>(ref: DocumentReference<T>, options?: ReactFireOptions<T>): ObservableStatus<T> { |
| 75 | const idField = options ? checkIdField(options) : 'NO_ID_FIELD'; |
| 76 | |
| 77 | const observableId = `firestore:docDataOnce:${ref.firestore.app.name}:${ref.path}:idField=${idField}`; |
| 78 | const observable$ = docData(ref, { idField }).pipe(first()); |
| 79 | |
| 80 | return useObservable(observableId, observable$, options); |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * Subscribe to a Firestore collection |
no test coverage detected