MCPcopy Create free account
hub / github.com/NiladriHazra/WhatToBuild / getKeyFilesCache

Function getKeyFilesCache

components/RepositoryKeyFiles.tsx:63–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

61
62// Use a global cache on window to persist across remounts/tab switches
63const getKeyFilesCache = (): { [key: string]: KeyFile[] } => {
64 if (typeof window !== 'undefined') {
65
66 if (!(window as any).__keyFilesCache) {
67 (window as any).__keyFilesCache = {};
68 }
69
70 return (window as any).__keyFilesCache;
71 }
72 // SSR fallback (shouldn't happen for this component)
73 return {};
74};
75
76 useEffect(() => {
77 // Declare controller and timeoutId in the outer scope so they are accessible in cleanup

Callers 2

fetchKeyFilesFunction · 0.85
handleFileClickFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected