Skip to content

Instantly share code, notes, and snippets.

View IkariMeister's full-sized avatar
🏠
Working from home

Juan Carlos Garcia Seco IkariMeister

🏠
Working from home
View GitHub Profile
suspend fun getCards() =
service.getCards()
.async(IO.async())
.fix()
.map { response ->
when (response.code()) {
200 -> response.body()?.cards?.right() ?: NoContent.left()
204 -> NoContent.left()
404 -> NoInternetConnection.left()
401 -> NotAllowedError.left()