fetch has no timeout, so AbortController is the timeout
A fetch to a server that accepts the connection and never answers waits forever, and so does whatever awaited it.
const res = await fetch(url, { signal: AbortSignal.timeout(5000) });AbortSignal.timeout is in every current runtime. Pass the same signal to anything downstream that supports it, so a cancelled request cancels the work it started too.
javascripthttp