Function useDocumentDataOnce

  • Returns the data of a Firestore DocumentReference

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

    Document data, loading state, and error

    • value: Document data; undefined if document does not exist, is currently being fetched, or an error occurred
    • loading: true while fetching the document; false if the document was fetched successfully or an error occurred
    • error: undefined if no error occurred