Skip to main content
Version: Annotations-V1.0.0

observable

@frost/frost-web / Exports / observable

Function: observable

observable(query, options?): Observable<DataSnapshot>

Example

In case of exact node

let value = observable(
child(
ref(this.db),
`/users/${userId}`,
),
).pipe(map(value => value.val()))

Example

In case of a query

let value = observable(
query(
ref(this.db, 'users'),
orderByChild('type'),
equalTo('student'),
)
).pipe(map(value => value.val()))

Parameters

NameTypeDescription
queryQuery(Firebase Type) a query object that will be passed to the onValue FirebaseDB Function (this gould be returned from child/query functions )
options?ListenOptions(Firebase Type) an object for the listening options on the onValue FirebaseDB Function

Returns

Observable<DataSnapshot>

an RX observable for the provided query