Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jorroll opened this issue Apr 7, 2023 · 1 comment
Open

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

jorroll opened this issue Apr 7, 2023 · 1 comment
Assignees

Comments

@jorroll
Copy link

jorroll commented Apr 7, 2023

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;
})
@davideast davideast self-assigned this Jul 11, 2023
@davideast
Copy link
Collaborator

@jorroll Apologies on the delay. I need to dive into this a bit deeper before making an update. I think it's a candidate when we bump from 6 to 7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants