Constructing layers in automatic form

Hello! I remember in Scala ZIO cool functionality, that lets you avoid specifying the order of dependencies when you construct final app layer. It's zio magic or something like that

Here I'd like to avoid to pass HttpClient layer twice:

  const appLayer = WebApiLive.pipe(
    Layer.provide(LoginServiceLive.pipe(
      Layer.provide(HttpClient.client.layer)
    )),
    Layer.provide(HttpClient.client.layer)
  );
Was this page helpful?