firebase / firebase/firebase-admin-node

onDocumentUpdate event is typed as having data potentially undefined

Open
#2,202 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.7k
Forks
419
Avg merge
3d 10h
Merged PRs (30d)
16

Description

It seems weird that an update event could contain nothing, if that's the case an update event did not occur, did it ?

```ts
// firestore.d.ts
export declare function onDocumentUpdated(document: Document, handler: (event: FirestoreEvent | undefined, ParamsOf>) => any | Promise): CloudFunction | undefined, ParamsOf>>;
```

It is annoying because it forces an additional, seemingly unnecessary, check.

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.