MCPcopy
hub / github.com/DefiLlama/chainlist / fetchWithCache

Function fetchWithCache

utils/fetch.js:10–17  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

8
9const cache = {};
10export const fetchWithCache = async (url) => {
11 if (cache[url]) {
12 return cache[url];
13 }
14 const data = await fetch(url).then((res) => res.json());
15 cache[url] = data;
16 return data;
17};
18
19function removeEndingSlashObject(rpc) {
20 if (typeof rpc === "string") {

Callers 7

getStaticPropsFunction · 0.90
getStaticPathsFunction · 0.90
getStaticPropsFunction · 0.90
getStaticPathsFunction · 0.90
getStaticPropsFunction · 0.90
getStaticPathsFunction · 0.90
generateChainDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected