FirebaseExtended / FirebaseExtended/rxfire

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

Open
#68 1 comment 0 reactions 1 assignee Claimed by @davideast View on GitHub
Dominant language
TypeScript
Stars
149
Forks
50
PR merge metrics
No merged PRs in 30d

Description

_Related, currently, the `docData` helper exported by this library is incorrectly typed (see issue #37) as it actually returns `Observable`._

This is a request to update `docData` to return `Observable`. 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:

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

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.