MCPcopy Create free account
hub / github.com/Noumena-Network/code / createAllTimeStatsPromise

Function createAllTimeStatsPromise

src/components/Stats.tsx:64–82  ·  view source on GitHub ↗

* Creates a stats loading promise that never rejects. * Always loads all-time stats for the heatmap.

()

Source from the content-addressed store, hash-verified

62 * Always loads all-time stats for the heatmap.
63 */
64function createAllTimeStatsPromise(): Promise<StatsResult> {
65 return aggregateClaudeCodeStatsForRange('all').then((data): StatsResult => {
66 if (!data || data.totalSessions === 0) {
67 return {
68 type: 'empty'
69 };
70 }
71 return {
72 type: 'success',
73 data
74 };
75 }).catch((err): StatsResult => {
76 const message = err instanceof Error ? err.message : 'Failed to load stats';
77 return {
78 type: 'error',
79 message
80 };
81 });
82}
83export function Stats(t0) {
84 const $ = _c(4);
85 const {

Callers 1

StatsFunction · 0.85

Calls 1

Tested by

no test coverage detected