Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a ZIO-style Service type for idiomaticity points
There's usually a `Service` trait nested within the objects which would define the interface (`send` and `openWebsocket` here). In lieu of that refactoring, it could be nice to expose a `Service` type alias such that it could be easily used when relying on SttpClient in ones own ZLayers. Then it would be trivial to refactor from ```scala def live(token: String): ZLayer[Console with SttpClient, Nothing, SlackClient] = ZLayer .fromServices[Console.Service, SttpBackend[Task, Stream[Throwable, Byte], WebSocketHandler], SlackClient.Service]( (console: Console.Service, sttp: SttpBackend[Task, Stream[Throwable, Byte], WebSocketHandler]) => LiveSlackClient(console, sttp, token) ) ``` to ```scala def live(token: String): ZLayer[Console with SttpClient, Nothing, SlackClient] = ZLayer .fromServices[Console.Service, SttpClient.Service, SlackClient.Service]( (console: Console.Service, sttp: SttpClient.Service) => LiveSlackClient(console, sttp, token) ) ``` Ahh, much better ;)
- Loading branch information