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

Function useCounter

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

Source from the content-addressed store, hash-verified

162 return store;
163}
164export function useCounter(name) {
165 const $ = _c(3);
166 const store = useStats();
167 let t0;
168 if ($[0] !== name || $[1] !== store) {
169 t0 = value => store.increment(name, value);
170 $[0] = name;
171 $[1] = store;
172 $[2] = t0;
173 } else {
174 t0 = $[2];
175 }
176 return t0;
177}
178export function useGauge(name) {
179 const $ = _c(3);
180 const store = useStats();

Callers

nothing calls this directly

Calls 1

useStatsFunction · 0.85

Tested by

no test coverage detected