( snapshots: QuerySnapshot<T> | undefined, options?: SnapshotOptions, initialValue?: T[] )
| 137 | }; |
| 138 | |
| 139 | const getValuesFromSnapshots = <T>( |
| 140 | snapshots: QuerySnapshot<T> | undefined, |
| 141 | options?: SnapshotOptions, |
| 142 | initialValue?: T[] |
| 143 | ): T[] | undefined => { |
| 144 | return useMemo( |
| 145 | () => |
| 146 | (snapshots?.docs.map((doc) => doc.data(options)) ?? initialValue) as |
| 147 | | T[] |
| 148 | | undefined, |
| 149 | [snapshots, options] |
| 150 | ); |
| 151 | }; |
| 152 | |
| 153 | const getDocsFnFromGetOptions = ( |
| 154 | { source }: GetOptions = { source: 'default' } |
no outgoing calls
no test coverage detected
searching dependent graphs…