firebase / firebase/firebase-admin-node

[FR] Add a function that initializes an App or returns existing one

Offen
#2,314 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
api: core type: feature request
Vorherrschende Sprache
TypeScript
Sterne
1.7k
Forks
419
Ø Merge
3 T. 10 Std.
Gemergte PRs (30 T.)
16

Beschreibung

**Is your feature request related to a problem? Please describe.**
A function `initializeApp` throws an error if the app is already existed at the time. As current workaround, we need to handle thrown error.
(related: https://github.com/firebase/firebase-admin-node/issues/2111 )

**Describe the solution you'd like**
Add a function wrapping `initializeApp` and `getApp`, that returns existing FirebaseApp, or initialize a new FirebaseApp if the app doesn't exist.

my sample implementation: https://github.com/arayaryoma/firebase-admin-node/commit/65be1703a0c4f8ede7fd34c63d71e05b38f48efb

**Describe alternatives you've considered**
Not yet

**Additional context**
If this proposal is affirmed, I can open a PullRequest.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.