I have an App Container which uses application con...
# android
v
I have an App Container which uses application context and where I initialize my android DataStore repository. Android's DataStore by default requires Context which I pass inside the App Container. I have a singleton called ApiClient that contains Kotlin Ktor's http methods. This api client needs to access the DataStore to retrieve data, such as persisted cookies. To achieve this, I would like to be able to pass the initialized DataStore repository into my ApiClient singleton. Is there a common practice for this? How can I pass down the data store repository into my ApiClient?
not kotlin but kotlin colored 2
s
Use the application context?