MCPcopy
hub / github.com/slopus/happy / useSettingMutable

Function useSettingMutable

packages/happy-app/sources/sync/storage.ts:1460–1466  ·  view source on GitHub ↗
(name: K)

Source from the content-addressed store, hash-verified

1458}
1459
1460export function useSettingMutable<K extends keyof Settings>(name: K): [Settings[K], (value: Settings[K]) => void] {
1461 const setValue = React.useCallback((value: Settings[K]) => {
1462 sync.applySettings({ [name]: value });
1463 }, [name]);
1464 const value = useSetting(name);
1465 return [value, setValue];
1466}
1467
1468export function useSetting<K extends keyof Settings>(name: K): Settings[K] {
1469 return storage(useShallow((state) => state.settings[name]));

Callers 10

SessionsListFunction · 0.90
InlineFileDiff.tsxFile · 0.90
voice.tsxFile · 0.90
LanguageSettingsScreenFunction · 0.90
account.tsxFile · 0.90
AppearanceSettingsScreenFunction · 0.90
FeaturesSettingsScreenFunction · 0.90
LanguageSelectionScreenFunction · 0.90

Calls 1

useSettingFunction · 0.85

Tested by

no test coverage detected