MCPcopy Index your code
hub / github.com/FirebaseExtended/reactfire / useFirestoreDocData

Function useFirestoreDocData

src/firestore.tsx:62–69  ·  view source on GitHub ↗
(ref: DocumentReference<T>, options?: ReactFireOptions<T>)

Source from the content-addressed store, hash-verified

60 * Suscribe to Firestore Document changes and unwrap the document into a plain object
61 */
62export 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

Callers 3

CounterFunction · 0.85
CounterFunction · 0.85
firestore.test.tsxFile · 0.85

Calls 2

checkIdFieldFunction · 0.85
useObservableFunction · 0.85

Tested by

no test coverage detected