* Helper function to construct type safe functions. Since Remote Config has * methods that return different types for values, we need to be extra safe * to make sure we are not returning improper types by accident. * @param key * @param getter * @param remoteConfig
(key: string, getter: Getter$<T>)
| 16 | * @param remoteConfig |
| 17 | */ |
| 18 | function useRemoteConfigValue_INTERNAL<T>(key: string, getter: Getter$<T>): ObservableStatus<T> { |
| 19 | const remoteConfig = useRemoteConfig(); |
| 20 | |
| 21 | const appName = remoteConfig.app.name; |
| 22 | const $value = getter(remoteConfig, key); |
| 23 | |
| 24 | const observableId = `remoteConfig:${key}:${getter.name}:${appName}`; |
| 25 | return useObservable<T>(observableId, $value); |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * Accepts a key and optionally a Remote Config instance. Returns a |
no test coverage detected