firebase / firebase/firebase-admin-node

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

未关闭
#2,314 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

api: core type: feature request
主要语言
TypeScript
星标
1.7k
派生
419
平均合并
3 天 10 小时
30 天内合并 PR
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.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先定位导出的 initializeApp 和 getApp 入口点及其现有测试。当新函数在已有 FirebaseApp 时返回它,或在不存在时初始化一个,并且测试覆盖这两种情况后,工作即完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
firebase, node.js, typescript
领域
api, backend
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。