the-moby-effect
Version:
Moby/Docker API client built using effect-ts
12 lines • 773 B
JavaScript
import * as Effect from "effect/Effect";
import * as Function from "effect/Function";
import * as Layer from "effect/Layer";
import * as Socket from "effect/unstable/socket/Socket";
import * as internalAgnostic from "./agnostic.js";
/** @internal */
export const makeWebHttpClientLayer = connectionOptions => {
const browserLayer = Function.pipe(Effect.promise(() => import("@effect/platform-browser/BrowserHttpClient")), Effect.map(browserHttpClientLazy => browserHttpClientLazy.layerXMLHttpRequest), Layer.unwrap);
const agnosticHttpClientLayer = internalAgnostic.makeAgnosticHttpClientLayer(connectionOptions);
return agnosticHttpClientLayer.pipe(Layer.merge(Socket.layerWebSocketConstructorGlobal), Layer.provide(browserLayer));
};
//# sourceMappingURL=web.js.map