MCPcopy Index your code
hub / github.com/FirebaseExtended/reactfire / useDatabaseObjectData

Function useDatabaseObjectData

src/database.tsx:34–40  ·  view source on GitHub ↗
(ref: DatabaseReference, options?: ReactFireOptions<T>)

Source from the content-addressed store, hash-verified

32}
33
34export function useDatabaseObjectData<T>(ref: DatabaseReference, options?: ReactFireOptions<T>): ObservableStatus<T> {
35 const idField = options ? checkIdField(options) : 'NO_ID_FIELD';
36 const observableId = `database:objectVal:${ref.toString()}:idField=${idField}`;
37 const observable$ = objectVal<T>(ref, { keyField: idField });
38
39 return useObservable(observableId, observable$, options);
40}
41
42/**
43 * Subscribe to a Realtime Database list

Callers 2

CounterFunction · 0.85
CounterFunction · 0.85

Calls 2

checkIdFieldFunction · 0.85
useObservableFunction · 0.85

Tested by

no test coverage detected