https://kotlinlang.org logo
Title
t

Trey

04/27/2022, 2:21 PM
I see that the HttpClient is declared in the data source. Is there a reason why the HttpClient instance wasn't injected into the data source? I'm asking because my app has to connect to two different servers that use the same auth token. It would be cool if I could share the HttpClient and leverage the bearer logic to refresh the token when necessary. Would that be a bad design?
r

russhwolf

04/27/2022, 4:14 PM
In KaMPKit we instantiate the client in-place and just inject the engine since that's the platform-specific component. But if you were using the client in multiple places then injecting it would probably be a good move.
👍 2