Function useQueryOnce

  • Returns the QuerySnapshot of a Firestore query. Does not update the QuerySnapshot once initially fetched

    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 UseQueryOnceResult<AppModelType>

    QuerySnapshot, loading state, 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