Function useQuery

  • Returns and updates a QuerySnapshot of a Firestore Query

    Type Parameters

    • AppModelType = DocumentData

      Shape of the data after it was converted from firestore

    • DbModelType extends DocumentData = DocumentData

      Shape of the data in firestore

    Parameters

    Returns UseQueryResult<AppModelType>

    QuerySnapshot, loading, and error

    • value: QuerySnapshot; 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