Skip to content

Feat: update docData to instead return Observable<T | null> #68

@jorroll

Description

@jorroll

Related, currently, the docData helper exported by this library is incorrectly typed (see issue #37) as it actually returns Observable<T | undefined>.

This is a request to update docData to return Observable<T | null>. Returning null rather than undefined when a document doesn't exist would be helpful when saving the output to a variable as it is easier to distinguish between a pending result (undefined) and a known null result. I realize that this would be a breaking change.

Example:

let myDocument: { one: number } | null | undefined;

docData(/* args */).subscribe(doc => {
  myDocument = doc;
})

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions