MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / refresh

Function refresh

freebuff/web/src/app/live/live-stats-client.ts:47–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45 let isMounted = true
46
47 async function refresh() {
48 if (pauseWhenHidden && document.visibilityState === 'hidden') {
49 return
50 }
51
52 try {
53 const response = await fetch('/api/live', { cache: 'no-store' })
54 if (response.ok && isMounted) {
55 setStats((await response.json()) as FreebuffLiveStats)
56 }
57 } catch {
58 // Keep the previous snapshot if a transient refresh fails.
59 }
60 }
61
62 if (refreshOnMount) {
63 void refresh()

Callers 2

useLiveStatsFunction · 0.85
refreshWhenVisibleFunction · 0.85

Calls 1

fetchFunction · 0.50

Tested by

no test coverage detected