NodeHttpClient.layerUndiciNoDispatcherconstrepos/effect/packages/platform-node/src/NodeHttpClient.ts:359Layer.Layer<Client.HttpClient, never, Dispatcher>Provides an Undici-backed HttpClient using the current Dispatcher
service.
export const const layerUndiciNoDispatcher: Layer.Layer<
Client.HttpClient,
never,
Dispatcher
>
const layerUndiciNoDispatcher: {
build: (memoMap: MemoMap, scope: Scope.Scope) => Effect<Context.Context<HttpClient>, never, Dispatcher>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Provides an Undici-backed HttpClient using the current Dispatcher
service.
layerUndiciNoDispatcher: import LayerLayer.interface Layer<in ROut, out E = never, out RIn = never>A Layer describes how to build one or more services for dependency injection.
When to use
Use to model construction of application services for dependency injection,
especially when services have dependencies, can fail during construction, or
need scoped setup and release.
Details
A Layer<ROut, E, RIn> represents ROut as the services this layer
provides, E as the possible errors during layer construction, and RIn as
the services this layer requires as dependencies.
Layer<
import ClientClient.HttpClient,
never,
class Dispatcherclass Dispatcher {
Service: Service;
key: Identifier;
}
Service tag for the Undici Dispatcher used by the Undici-backed HTTP
client.
Dispatcher
> = import ClientClient.const layerMergedContext: <E, R>(
effect: Effect.Effect<Client.HttpClient, E, R>
) => Layer.Layer<Client.HttpClient, E, R>
Creates an HttpClient layer and merges the layer construction context into client response effects.
layerMergedContext(const makeUndici: Effect.Effect<
Client.HttpClient,
never,
Dispatcher
>
const makeUndici: {
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
Creates an HttpClient that sends requests through the current Undici
Dispatcher, converts Effect HTTP bodies to Undici bodies, and maps
transport and decode failures to HttpClientError.
makeUndici)