Skip to content

Instantly share code, notes, and snippets.

@timusus
Created October 20, 2018 03:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timusus/76db5e439346cae1466815c8973efba5 to your computer and use it in GitHub Desktop.
Save timusus/76db5e439346cae1466815c8973efba5 to your computer and use it in GitHub Desktop.
Sealed result Retrofit enqueue snippet
call.enqueue {
override fun onResult(result: Result) {
when(result){
is Success -> {
// Handle Success
}
is Failure -> {
// Handle failure
result.error.doSomething()
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment