Skip to main content

fetchWithTimeout

FitFileViewer - API Documentation v30.0.1


FitFileViewer - API Documentation / utils/net/networkUtils / fetchWithTimeout

Function: fetchWithTimeout()

fetchWithTimeout(url: string, timeoutMs: number, init?: RequestInit, runtime?: NetworkUtilsRuntime): Promise<Response>

Defined in: utils/net/networkUtils.ts:22

Best-effort fetch with a timeout.

Parameters​

url​

string

URL to fetch.

timeoutMs​

number

Timeout in milliseconds.

init?​

RequestInit = {}

Optional fetch init.

runtime?​

NetworkUtilsRuntime = ...

Returns​

Promise<Response>

The fetch response.