( docRef?: DocumentReference<T> | null, options?: DataOptions<T> & InitialValueOptions<T> )
| 109 | }; |
| 110 | |
| 111 | export const useDocumentData = <T = DocumentData>( |
| 112 | docRef?: DocumentReference<T> | null, |
| 113 | options?: DataOptions<T> & InitialValueOptions<T> |
| 114 | ): DocumentDataHook<T> => { |
| 115 | const [snapshot, loading, error] = useDocument<T>(docRef, options); |
| 116 | |
| 117 | const value = getValueFromSnapshot( |
| 118 | snapshot, |
| 119 | options?.snapshotOptions, |
| 120 | options?.initialValue |
| 121 | ); |
| 122 | |
| 123 | return [value, loading, error, snapshot]; |
| 124 | }; |
| 125 | |
| 126 | export const useDocumentDataOnce = <T = DocumentData>( |
| 127 | docRef?: DocumentReference<T> | null, |
nothing calls this directly
no test coverage detected