Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[FEATURE] Using a remote config value with a generic type

Đang mở
#511 0 bình luận 1 reaction 1 người được giao Xem trên GitHub

@HYACCCINT đang làm issue này rồi.

Từ ngày 29/6/2023.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

feature request v5

When using JSON in remote config parameter, we have to parse by ourselves the JSON, could be cleaner with generic type?

Current usage

interface MyAwesomeRemoteConfigParameter {
    buttonColor: "blue" | "red";
    autoDestruction: boolean;
}

const {data: myParamJsonString} = useRemoteConfigString("my_awesome_remote_config_parameter");
const myParam: MyAwesomeRemoteConfigParameter | undefined = myParamJsonString ? 
    JSON.parse(myParamJsonString) :
    undefined;

Desired usage

interface MyAwesomeRemoteConfigParameter {
    buttonColor: "blue" | "red";
    autoDestruction: boolean;
}

const {data: myParam} = useRemoteConfigValue<MyAwesomeRemoteConfigParameter>("my_awesome_remote_config_parameter");
// myParam is parsed with MyAwesomeRemoteConfigParameter interface
Ngôn ngữ chính
TypeScript
Star
3.6k
Fork
403
Merge trung bình
5 ngày 1 giờ
Pull request đã merge (30 ngày)
10

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

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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của FirebaseExtended/reactfire

Tất cả issue của FirebaseExtended/reactfire

Issue tương tự

Thêm issue về TypeScript

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.