Skip to content

Instantly share code, notes, and snippets.

View IkariMeister's full-sized avatar

Juan Carlos Garcia Seco IkariMeister

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()