MCPcopy Create free account
hub / github.com/AmazingAng/PolyWorld / fetchJsonWithTimeout

Function fetchJsonWithTimeout

src/components/OrderForm.tsx:58–61  ·  view source on GitHub ↗
(input: RequestInfo | URL, init: RequestInit, timeoutMs = REQUEST_TIMEOUT_MS)

Source from the content-addressed store, hash-verified

56}
57
58async function fetchJsonWithTimeout(input: RequestInfo | URL, init: RequestInit, timeoutMs = REQUEST_TIMEOUT_MS) {
59 const signal = AbortSignal.timeout(timeoutMs);
60 return fetch(input, { ...init, signal });
61}
62
63function sleep(ms: number) {
64 return new Promise((resolve) => setTimeout(resolve, ms));

Callers 1

OrderFormFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected