Function useQueriesData

  • Returns and updates a the document data of multiple Firestore queries

    Type Parameters

    • AppModelTypes extends readonly unknown[] = readonly DocumentData[]

      Tuple of shapes of the data after it was converted from firestore

    • DbModelTypes extends readonly DocumentData[] = readonly DocumentData[]

      Tuple of shapes of the data in firestore

    Parameters

    • queries: {
          [Index in string | number | symbol]: Query<AppModelTypes[Index<Index>], DbModelTypes[number]>
      }

      Firestore queries that will be subscribed to

    • Optionaloptions: UseQueriesDataOptions

      Options to configure the subscription

    Returns UseQueriesDataResult<AppModelTypes>

    Array with tuple for each query:

    • value: Query data; undefined if query is currently being fetched, or an error occurred
    • loading: true while fetching the query; false if the query was fetched successfully or an error occurred
    • error: undefined if no error occurred