Skip to content

Instantly share code, notes, and snippets.

@JanStoltman
JanStoltman / ApiClientServiceImpl.kt
Last active September 21, 2020 07:53
`backgroundSuspend` method is the same as in DroidconKotlin example. All classes are brought together using Kodein dependency injection.
class ApiClientServiceImpl(
client: HttpClient, parser: JsonParser
) : BaseApiClientService(client, parser) {
override suspend fun getCategories() =
requestCatching(Category.serializer().list) {
get()
apiUrl("/api/product/live/category/list")
accessHeaders()