Skip to content

ambientSignalFetch

ambientSignalFetch(base?): {(input, init?): Promise<Response>; (input, init?): Promise<Response>; }

Defined in: packages/core/src/runtime/callSignalContext.ts:101

Wrap a fetch so that every request it makes is also aborted by the ambient call signal.

The request’s own signal is preserved rather than replaced. The ollama client aborts its streamed requests through a controller of its own, and dropping that would trade one leak for another — so the two are composed, and the request aborts when either fires.

Outside a deadline there is no ambient signal and the call is passed through untouched, so installing this on a client costs nothing when no deadline is running.

{(input, init?): Promise<Response>; (input, init?): Promise<Response>; }

The fetch to delegate to. Defaults to the global one.

A fetch with the same signature, safe to hand to a client constructor.

(input, init?): Promise<Response>

MDN Reference

URL | RequestInfo

RequestInit

Promise<Response>

(input, init?): Promise<Response>

MDN Reference

string | URL | Request

RequestInit

Promise<Response>