MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / useDynamicConfig

Function useDynamicConfig

source code/hooks/useDynamicConfig.ts:10–24  ·  view source on GitHub ↗
(configName: string, defaultValue: T)

Source from the content-addressed store, hash-verified

8 * Returns the default value initially, then updates when the config is fetched.
9 */
10export function useDynamicConfig<T>(configName: string, defaultValue: T): T {
11 const [configValue, setConfigValue] = React.useState<T>(defaultValue)
12
13 React.useEffect(() => {
14 if (process.env.NODE_ENV === 'test') {
15 // Prevents a test hang when using this hook in tests
16 return
17 }
18 void getDynamicConfig_BLOCKS_ON_INIT<T>(configName, defaultValue).then(
19 setConfigValue,
20 )
21 }, [configName, defaultValue])
22
23 return configValue
24}

Callers 1

useFeedbackSurveyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected