firebase / firebase/firebase-admin-node

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

オープン
#2,314 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
api: core type: feature request
主要言語
TypeScript
スター
1.7k
フォーク
419
平均マージ
3日 10時間
マージ済み PR(30日)
16

説明

**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.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。