MCPcopy Create free account
hub / github.com/freecodexyz/free-code / useTimer

Function useTimer

src/context/stats.tsx:192–205  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

190 return t0;
191}
192export function useTimer(name) {
193 const $ = _c(3);
194 const store = useStats();
195 let t0;
196 if ($[0] !== name || $[1] !== store) {
197 t0 = value => store.observe(name, value);
198 $[0] = name;
199 $[1] = store;
200 $[2] = t0;
201 } else {
202 t0 = $[2];
203 }
204 return t0;
205}
206export function useSet(name) {
207 const $ = _c(3);
208 const store = useStats();

Callers

nothing calls this directly

Calls 1

useStatsFunction · 0.85

Tested by

no test coverage detected