MCPcopy Create free account
hub / github.com/UI5/webcomponents / fetchJsonOnce

Function fetchJsonOnce

packages/base/src/util/FetchHelper.ts:18–29  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

16};
17
18const fetchJsonOnce = async (url: string) => {
19 if (!fetchPromises.get(url)) {
20 fetchPromises.set(url, fetch(url));
21 }
22 const response = await fetchPromises.get(url);
23
24 if (response && !jsonPromises.get(url)) {
25 jsonPromises.set(url, response.json());
26 }
27
28 return jsonPromises.get(url);
29};
30
31export { fetchTextOnce, fetchJsonOnce };

Callers

nothing calls this directly

Calls 2

getMethod · 0.80
fetchFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…