MCPcopy Create free account
hub / github.com/TheCSir/TerminalStart / saveCache

Function saveCache

src/hooks/useMarketData.ts:23–27  ·  view source on GitHub ↗
(provider: MarketProvider, quotes: MarketQuote[])

Source from the content-addressed store, hash-verified

21}
22
23function saveCache(provider: MarketProvider, quotes: MarketQuote[]) {
24 try {
25 localStorage.setItem(cacheKey(provider), JSON.stringify({ quotes, timestamp: Date.now() }));
26 } catch { /* quota exceeded — ignore */ }
27}
28
29// --- Yahoo Finance ---
30async function fetchYahoo(symbol: string): Promise<MarketQuote> {

Callers 1

useMarketDataFunction · 0.70

Calls 1

cacheKeyFunction · 0.85

Tested by

no test coverage detected