(ref: DocumentReference<T>, options?: ReactFireOptions<T>)
| 60 | * Suscribe to Firestore Document changes and unwrap the document into a plain object |
| 61 | */ |
| 62 | export function useFirestoreDocData<T = unknown>(ref: DocumentReference<T>, options?: ReactFireOptions<T>): ObservableStatus<T> { |
| 63 | const idField = options ? checkIdField(options) : 'NO_ID_FIELD'; |
| 64 | |
| 65 | const observableId = `firestore:docData:${ref.firestore.app.name}:${ref.path}:idField=${idField}`; |
| 66 | const observable = docData(ref, { idField }); |
| 67 | |
| 68 | return useObservable(observableId, observable, options); |
| 69 | } |
| 70 | |
| 71 | /** |
| 72 | * Get a Firestore document, unwrap the document into a plain object, and don't subscribe to changes |
no test coverage detected