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

Function useFirestoreCollectionData

src/firestore.tsx:96–102  ·  view source on GitHub ↗
(query: FirestoreQuery<T>, options?: ReactFireOptions<T[]>)

Source from the content-addressed store, hash-verified

94 * Subscribe to a Firestore collection and unwrap the snapshot into an array.
95 */
96export function useFirestoreCollectionData<T = DocumentData>(query: FirestoreQuery<T>, options?: ReactFireOptions<T[]>): ObservableStatus<T[]> {
97 const idField = options ? checkIdField(options) : 'NO_ID_FIELD';
98 const observableId = `firestore:collectionData:${getUniqueIdForFirestoreQuery(query)}:idField=${idField}`;
99 const observable$ = collectionData(query, { idField });
100
101 return useObservable(observableId, observable$, options);
102}

Callers 3

ListFunction · 0.85
AnimalsListFunction · 0.85
firestore.test.tsxFile · 0.85

Calls 3

checkIdFieldFunction · 0.85
useObservableFunction · 0.85

Tested by

no test coverage detected