Fetch.variables.FetchLive
Variable: FetchLive
Section titled “Variable: FetchLive”
constFetchLive:Type
Defined in: packages/fx-fetch/src/Fetch/FetchLive.ts:38
Live implementation of the Fetch service that performs actual HTTP requests.
Example
Section titled “Example”import { Effect } from 'effect';import { Fetch, Request, Response } from 'fx-fetch';
// ┌─── Effect.Effect<// │ Response.Response,// │ | Fetch.FetchError// │ | Fetch.AbortError// │ | Fetch.NotAllowedError// │ | Response.NotOkError,// │ never// │ >// ▼const program = Effect.gen(function* () { const request = Request.unsafeMake({ url: 'https://example.com' });
// ┌─── Response.Response // ▼ const response = yield* Fetch.FetchLive(request);
return response;});0.1.0