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

Function make

packages/platform/src/HttpApiClient.ts:250–268  ·  view source on GitHub ↗
(
  api: HttpApi.HttpApi<ApiId, Groups, ApiError, ApiR>,
  options?: {
    readonly transformClient?: ((client: HttpClient.HttpClient) => HttpClient.HttpClient) | undefined
    readonly transformResponse?:
      | ((effect: Effect.Effect<unknown, unknown>) => Effect.Effect<unknown, unknown>)
      | undefined
    readonly baseUrl?: URL | string | undefined
  }
)

Source from the content-addressed store, hash-verified

248 * @category constructors
249 */
250export const make = <ApiId extends string, Groups extends HttpApiGroup.Any, ApiError, ApiR>(
251 api: HttpApi.HttpApi<ApiId, Groups, ApiError, ApiR>,
252 options?: {
253 readonly transformClient?: ((client: HttpClient.HttpClient) => HttpClient.HttpClient) | undefined
254 readonly transformResponse?:
255 | ((effect: Effect.Effect<unknown, unknown>) => Effect.Effect<unknown, unknown>)
256 | undefined
257 readonly baseUrl?: URL | string | undefined
258 }
259): Effect.Effect<
260 Simplify<Client<Groups, ApiError, never>>,
261 never,
262 HttpApiMiddleware.HttpApiMiddleware.Without<ApiR | HttpApiGroup.ClientContext<Groups>> | HttpClient.HttpClient
263> =>
264 Effect.flatMap(HttpClient.HttpClient, (httpClient) =>
265 makeWith(api, {
266 ...options,
267 httpClient: options?.transformClient ? options.transformClient(httpClient) : httpClient
268 }))
269
270/**
271 * @since 1.0.0

Callers

nothing calls this directly

Calls 1

makeWithFunction · 0.70

Tested by

no test coverage detected