MCPcopy Index your code
hub / github.com/FirebaseExtended/reactfire / useRemoteConfigValue_INTERNAL

Function useRemoteConfigValue_INTERNAL

src/remote-config.tsx:18–26  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

16 * @param remoteConfig
17 */
18function 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

Callers 5

useRemoteConfigValueFunction · 0.85
useRemoteConfigStringFunction · 0.85
useRemoteConfigNumberFunction · 0.85
useRemoteConfigBooleanFunction · 0.85
useRemoteConfigAllFunction · 0.85

Calls 2

useObservableFunction · 0.90
useRemoteConfigFunction · 0.85

Tested by

no test coverage detected