Function useObjectOnce

  • Returns and updates the DataSnapshot of the Realtime Database query. Does not update the DataSnapshot once initially fetched

    Parameters

    • query: undefined | null | Query

      Realtime Database query

    Returns UseObjectOnceResult

    User, loading state, and error

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