Function useDocumentOnce

  • Returns the DocumentSnapshot of a Firestore DocumentReference. Does not update the DocumentSnapshot 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 UseDocumentOnceResult<AppModelType>

    DocumentSnapshot, loading state, and error

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