MCPcopy Index your code
hub / github.com/OpenSIST/OpenSIST.github.io / removeCacheValue

Function removeCacheValue

src/Data/CacheStore.js:98–114  ·  view source on GitHub ↗
(key, {requestEpoch = cacheEpoch, requestVersion} = {})

Source from the content-addressed store, hash-verified

96}
97
98export async function removeCacheValue(key, {requestEpoch = cacheEpoch, requestVersion} = {}) {
99 if (requestEpoch !== cacheEpoch) {
100 return false;
101 }
102 const version = requestVersion ?? nextRequestVersion(key);
103 if (version < (latestRequestVersions.get(key) ?? 0)) {
104 return false;
105 }
106 memoryCache.delete(key);
107 return enqueueCacheWrite(key, async () => {
108 if (requestEpoch !== cacheEpoch || version < (latestRequestVersions.get(key) ?? 0)) {
109 return false;
110 }
111 await localforage.removeItem(key);
112 return true;
113 });
114}
115
116export async function clearDataCache() {
117 const theme = await localforage.getItem("theme");

Callers 1

toggleAnonymousFunction · 0.90

Calls 2

nextRequestVersionFunction · 0.85
enqueueCacheWriteFunction · 0.85

Tested by

no test coverage detected