How to Pipe an HttpClient Request into an Effect in TypeScript

I'm having a brain fart I think. If I have an declare const getClient = Effect<HttpClient.HttpClient>, and I want to pipe a request to the client:

HttpClientRequest.get(url).pipe(
  getClient,
  Effect.scoped,
);


Clearly getClient doesn't fit the type—is there something I can do to allow piping the request into getClient without having to invert this into:

getClient.pipe(
  Effect.flatMap(client => client(HttpClientRequest.get(url)),
  Effect.scoped,
);
Was this page helpful?