MCPcopy Index your code
hub / github.com/CSFrequency/react-firebase-hooks / getValueFromSnapshot

Function getValueFromSnapshot

firestore/useDocument.ts:158–167  ·  view source on GitHub ↗
(
  snapshot: DocumentSnapshot<T> | undefined,
  options?: SnapshotOptions,
  initialValue?: T
)

Source from the content-addressed store, hash-verified

156};
157
158const getValueFromSnapshot = <T>(
159 snapshot: DocumentSnapshot<T> | undefined,
160 options?: SnapshotOptions,
161 initialValue?: T
162): T | undefined => {
163 return useMemo(
164 () => (snapshot?.data(options) ?? initialValue) as T | undefined,
165 [snapshot, options, initialValue]
166 );
167};

Callers 2

useDocumentDataFunction · 0.85
useDocumentDataOnceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected