firebase / firebase/firebase-admin-node
[FR] Add a function that initializes an App or returns existing one
- 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
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