MCPcopy Create free account
hub / github.com/OpenSIST/OpenSIST.github.io / clearDataCache

Function clearDataCache

src/Data/CacheStore.js:116–132  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

114}
115
116export async function clearDataCache() {
117 const theme = await localforage.getItem("theme");
118 cacheEpoch += 1;
119 await Promise.allSettled([...writeQueues.values()]);
120 memoryCache.clear();
121 latestRequestVersions.clear();
122 foregroundRequests.clear();
123 foregroundLoads.clear();
124 backgroundLoads.clear();
125 await localforage.clear();
126 if (theme) {
127 await localforage.setItem("theme", theme);
128 }
129 if (typeof window !== "undefined") {
130 window.dispatchEvent(new Event(CACHE_CLEARED_EVENT));
131 }
132}
133
134export function getCacheEpoch() {
135 return cacheEpoch;

Callers 1

emptyCacheFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected