MCPcopy Create free account
hub / github.com/CSFrequency/react-firebase-hooks / useCollectionData

Function useCollectionData

firestore/useCollection.ts:106–119  ·  view source on GitHub ↗
(
  query?: Query<T> | null,
  options?: DataOptions<T> & InitialValueOptions<T[]>
)

Source from the content-addressed store, hash-verified

104};
105
106export const useCollectionData = <T = DocumentData>(
107 query?: Query<T> | null,
108 options?: DataOptions<T> & InitialValueOptions<T[]>
109): CollectionDataHook<T> => {
110 const [snapshots, loading, error] = useCollection<T>(query, options);
111
112 const values = getValuesFromSnapshots<T>(
113 snapshots,
114 options?.snapshotOptions,
115 options?.initialValue
116 );
117
118 return [values, loading, error, snapshots];
119};
120
121export const useCollectionDataOnce = <T = DocumentData>(
122 query?: Query<T> | null,

Callers

nothing calls this directly

Calls 2

useCollectionFunction · 0.85
getValuesFromSnapshotsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…