MCPcopy
hub / github.com/codeaashu/claude-code / useVoiceState

Function useVoiceState

src/context/voice.tsx:55–69  ·  view source on GitHub ↗
(selector)

Source from the content-addressed store, hash-verified

53 * value changes (compared via Object.is).
54 */
55export function useVoiceState(selector) {
56 const $ = _c(3);
57 const store = useVoiceStore();
58 let t0;
59 if ($[0] !== selector || $[1] !== store) {
60 t0 = () => selector(store.getState());
61 $[0] = selector;
62 $[1] = store;
63 $[2] = t0;
64 } else {
65 t0 = $[2];
66 }
67 const get = t0;
68 return useSyncExternalStore(store.subscribe, get, get);
69}
70
71/**
72 * Get the voice state setter. Stable reference — never causes re-renders.

Callers 5

TextInputFunction · 0.85
ModeIndicatorFunction · 0.85
NotificationContentFunction · 0.85
useVoiceIntegrationFunction · 0.85

Calls 1

useVoiceStoreFunction · 0.85

Tested by

no test coverage detected