firebase / firebase/firebase-admin-node

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

Đang mở
#2,314 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
api: core type: feature request
Ngôn ngữ chính
TypeScript
Star
1.7k
Fork
419
Merge trung bình
3 ngày 10 giờ
Pull request đã merge (30 ngày)
16

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách xác định các entry point được export là initializeApp và getApp cùng các bài kiểm thử hiện có của chúng. Công việc hoàn tất khi hàm mới trả về một FirebaseApp hiện có hoặc khởi tạo một FirebaseApp khi chưa có, với các bài kiểm thử bao quát cả hai trường hợp.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
firebase, node.js, typescript
Lĩnh vực
api, backend
Loại issue
Tính năng
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.