Repository navigation
docs(database): fix objectVal/listVal docs and multiple instances example - #3857
Merged
Merged
Conversation
…mple - Swap the reversed descriptions of objectVal() and listVal(), and fix listVal() return type (Observable<T[]>) and parameter name (query) - Update Reference to DatabaseReference in the convenience observable tables - Fix options:? typo in the stateChanges table - Use inject(FirebaseApp) in provideDatabase() in the Working with multiple instances example
armando-navarro
approved these changes
Dec 3, 2026
armando-navarro
left a comment
Collaborator
There was a problem hiding this comment.
Hi @AdamBoczula, thanks for this. The provideDatabase calls in the multiple instances example on main are a type error, so I'm glad to see them fixed. Approving.
Optional, on the same page
- The
list,stateChangesandauditTrailtables still call the first parameterref. The functions call itquery, as yourobjectandlistValtables now do. - The
stateChangesdescription sayseventsfilters which child events "populate the array".stateChangesemits oneQueryChangeat a time, so "which child events are emitted" would be accurate.
Let me know if you'd rather leave these, and I'll merge it as it is.
Contributor
Author
|
Thanks for the review @armando-navarro! |
armando-navarro
added a commit
to armando-navarro/angularfire
that referenced
this pull request
Dec 3, 2026
…mple (angular#3857) * docs(database): fix objectVal/listVal docs and multiple instances example - Swap the reversed descriptions of objectVal() and listVal(), and fix listVal() return type (Observable<T[]>) and parameter name (query) - Update Reference to DatabaseReference in the convenience observable tables - Fix options:? typo in the stateChanges table - Use inject(FirebaseApp) in provideDatabase() in the Working with multiple instances example * docs(database): use query param in list tables and clarify stateChanges --------- Co-authored-by: Armando Navarro <adnavarro@google.com> (cherry picked from commit 1256182)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
yarn install,yarn testrun successfully? not run (Markdown only)Description
Fixes several inaccuracies in
docs/database.md:objectVal()andlistVal()descriptions:objectVal()emits the value of a single node (Observable<T>), whilelistVal()emits an array of child values (Observable<T[]>). Also fixeslistVal()'s parameter name (ref->query) and return type (Observable<T | null>->Observable<T[]>).Referencetype withDatabaseReferencein the convenience observable tables (object,objectVal,list,listVal,stateChanges,auditTrail,fromRef), and aligns the Markdown tables.options:?->options?:in thestateChangestable.provideDatabase((app: FirebaseApp) => getDatabase(app, ...))toprovideDatabase(() => getDatabase(inject(FirebaseApp), ...)), sinceprovideDatabasetakes(injector: Injector) => FirebaseDatabaserather thanFirebaseApp.Verification
Checked directly against the source signatures:
src/database/database.module.ts:provideDatabase(fn: (injector: Injector) => FirebaseDatabase, ...deps: any[])src/database/firebase.ts/firebase/database:DatabaseReferenceextendsQueryrxfire(database/object/index.tsanddatabase/list/index.ts):objectVal<T>(query: Query, options?: { keyField?: string }): Observable<T>andlistVal<T>(query: Query, options?: { keyField?: string }): Observable<T[]>