Skip to main content Link Search Menu Expand Document (external link)

Fetch overview

Added in v1.0.0


Table of contents


constructors

effect

Constructs a Fetch layer from the specified effect that produces the given platform adapter

Signature

export declare const effect: <R, E>(fetch: Effect<Adapter, E, R>) => Layer<Fetch, E, R>

Added in v1.0.0

fetch

Signature

export declare const fetch: (url: string | URL, init?: RequestInit | undefined) => Effect<Response, HttpError, Fetch>

Added in v1.0.0

fetch_

Constructs a request whose response is a Response wrapper with the decode methods replace with their Effect conterparts

Signature

export declare const fetch_: (
  url: string | URL,
  init?: RequestInit | undefined
) => Effect<HttpResponse, HttpError, Fetch>

Added in v1.0.0

make

Constructs a Fetch layer using the given platform adapter

Signature

export declare const make: (fetch: Adapter) => Layer<Fetch, never, never>

Added in v1.0.0

model

Adapter (interface)

Signature

export interface Adapter {
  (url: string | URL | HttpRequest, init?: RequestInit): Effect<Response, HttpError, never>
}

Added in v1.0.0

tag

Fetch (class)

Signature

export declare class Fetch

Added in v1.0.0