MCPcopy Create free account
hub / github.com/ShivaBhattacharjee/KeyZen / loadData

Function loadData

public/code/javascript/04_promises.js:1–11  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

1function loadData(url) {
2 return new Promise((resolve, reject) => {
3 setTimeout(() => {
4 if (url) {
5 resolve({ data: "loaded" });
6 } else {
7 reject(new Error("No URL"));
8 }
9 }, 500);
10 });
11}
12
13loadData("/api/data")
14 .then(res => {

Callers 1

04_promises.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected