firebase / firebase/firebase-admin-node
onDocumentUpdate event is typed as having data potentially undefined
- Vorherrschende Sprache
- TypeScript
- Sterne
- 1.7k
- Forks
- 419
- Ø Merge
- 3 T. 10 Std.
- Gemergte PRs (30 T.)
- 16
Beschreibung
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.
Beitragsleitfaden
Rechercherichtung
Start with the firestore.d.ts declaration shown in the issue and inspect the onDocumentUpdated event type. Confirm the intended non-optional event type and verify that the generated declaration no longer requires an unnecessary undefined check.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- firebase, typescript
- Bereich
- api, backend
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 45/100