Function useObjectValueOnce

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

    Type Parameters

    • Value = unknown

      Type of the object value

    Parameters

    • query: undefined | null | Query

      Realtime Database query

    • Optionaloptions: UseObjectValueOnceOptions<Value>

      Options to configure how the object is fetched converter: Function to extract the desired data from the DataSnapshot. Similar to Firestore converters. Default: snap.val().

    Returns UseObjectValueOnceResult<Value>

    User, loading state, and error

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