MCPcopy Index your code
hub / github.com/codeaashu/claude-code / ClockProvider

Function ClockProvider

src/ink/components/ClockContext.tsx:75–108  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

73// The clock value is stable (created once via useState), so the provider
74// never causes consumer re-renders on its own.
75export function ClockProvider(t0) {
76 const $ = _c(7);
77 const {
78 children
79 } = t0;
80 const [clock] = useState(_temp);
81 const focused = useTerminalFocus();
82 let t1;
83 let t2;
84 if ($[0] !== clock || $[1] !== focused) {
85 t1 = () => {
86 clock.setTickInterval(focused ? FRAME_INTERVAL_MS : BLURRED_TICK_INTERVAL_MS);
87 };
88 t2 = [clock, focused];
89 $[0] = clock;
90 $[1] = focused;
91 $[2] = t1;
92 $[3] = t2;
93 } else {
94 t1 = $[2];
95 t2 = $[3];
96 }
97 useEffect(t1, t2);
98 let t3;
99 if ($[4] !== children || $[5] !== clock) {
100 t3 = <ClockContext.Provider value={clock}>{children}</ClockContext.Provider>;
101 $[4] = children;
102 $[5] = clock;
103 $[6] = t3;
104 } else {
105 t3 = $[6];
106 }
107 return t3;
108}
109function _temp() {
110 return createClock(FRAME_INTERVAL_MS);
111}

Callers

nothing calls this directly

Calls 1

useTerminalFocusFunction · 0.85

Tested by

no test coverage detected