( query?: Query<T> | null, options?: DataOptions<T> & InitialValueOptions<T[]> )
| 104 | }; |
| 105 | |
| 106 | export 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 | |
| 121 | export const useCollectionDataOnce = <T = DocumentData>( |
| 122 | query?: Query<T> | null, |
nothing calls this directly
no test coverage detected
searching dependent graphs…