Function useObjectValue

  • Returns and updates the DataSnapshot of the Realtime Database query

    Type Parameters

    • Value = unknown

      Type of the object value

    Parameters

    • query: undefined | null | Query

      Realtime Database query

    • Optionaloptions: UseObjectValueOptions<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(). initialValue: Value that is returned while the object is being fetched.

    Returns UseObjectValueResult<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