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

Function useCollectionDataOnce

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

Source from the content-addressed store, hash-verified

119};
120
121export const useCollectionDataOnce = <T = DocumentData>(
122 query?: Query<T> | null,
123 options?: OnceDataOptions<T> & InitialValueOptions<T[]>
124): CollectionDataOnceHook<T> => {
125 const [snapshots, loading, error, reloadData] = useCollectionOnce<T>(
126 query,
127 options
128 );
129
130 const values = getValuesFromSnapshots<T>(
131 snapshots,
132 options?.snapshotOptions,
133 options?.initialValue
134 );
135
136 return [values, loading, error, snapshots, reloadData];
137};
138
139const getValuesFromSnapshots = <T>(
140 snapshots: QuerySnapshot<T> | undefined,

Callers

nothing calls this directly

Calls 2

useCollectionOnceFunction · 0.85
getValuesFromSnapshotsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…