MCPcopy Index your code
hub / github.com/Effect-TS/effect / makeWith

Function makeWith

packages/platform/src/internal/httpClient.ts:143–156  ·  view source on GitHub ↗
(
  postprocess: (
    request: Effect.Effect<ClientRequest.HttpClientRequest, E2, R2>
  ) => Effect.Effect<ClientResponse.HttpClientResponse, E, R>,
  preprocess: Client.HttpClient.Preprocess<E2, R2>
)

Source from the content-addressed store, hash-verified

141
142/** @internal */
143export const makeWith = <E2, R2, E, R>(
144 postprocess: (
145 request: Effect.Effect<ClientRequest.HttpClientRequest, E2, R2>
146 ) => Effect.Effect<ClientResponse.HttpClientResponse, E, R>,
147 preprocess: Client.HttpClient.Preprocess<E2, R2>
148): Client.HttpClient.With<E, R> => {
149 const self = Object.create(ClientProto)
150 self.preprocess = preprocess
151 self.postprocess = postprocess
152 self.execute = function(request: ClientRequest.HttpClientRequest) {
153 return postprocess(preprocess(request))
154 }
155 return self
156}
157
158const responseRegistry = globalValue(
159 "@effect/platform/HttpClient/responseRegistry",

Callers 2

makeFunction · 0.70
httpClient.tsFile · 0.70

Calls 1

createMethod · 0.80

Tested by

no test coverage detected