sttp icon indicating copy to clipboard operation
sttp copied to clipboard

ZIO helper to summon `SttpBackend[Task, Any]`

Open Fristi opened this issue 3 years ago • 1 comments

In our ZIO 2 code we use this pattern a lot

ZIO.serviceWithZIO[SttpBackend[Task, Any]](_.send(...))

Would be nice if there is shortcut like Sttp.send orsomething?

Fristi avatar Sep 14 '22 07:09 Fristi

If this is still a pattern in ZIO2, then sure. We used to have SttpClient (https://github.com/softwaremill/sttp/blob/master/async-http-client-backend/zio1/src/main/scala/sttp/client3/asynchttpclient/zio/package.scala#L13-L18), so I guess you're asking for sth similar.

However I thought that now dependencies should be passed with constructors?

adamw avatar Sep 14 '22 13:09 adamw