Open louis030195 opened 2 years ago
When using JSON in remote config parameter, we have to parse by ourselves the JSON, could be cleaner with generic type?
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;
interface MyAwesomeRemoteConfigParameter { buttonColor: "blue" | "red"; autoDestruction: boolean; } const {data: myParam} = useRemoteConfigValue<MyAwesomeRemoteConfigParameter>("my_awesome_remote_config_parameter"); // myParam is parsed with MyAwesomeRemoteConfigParameter interface
When using JSON in remote config parameter, we have to parse by ourselves the JSON, could be cleaner with generic type?
Current usage
Desired usage