observable
@frost-orm/frost-web-client / 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
| Name | Type | Description |
|---|---|---|
query | Query | (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