Skip to content

Instantly share code, notes, and snippets.

@lowellk
Last active August 11, 2020 16:23
Show Gist options
  • Save lowellk/ec9fa704bb2c927e49ba183a080b843d to your computer and use it in GitHub Desktop.
Save lowellk/ec9fa704bb2c927e49ba183a080b843d to your computer and use it in GitHub Desktop.
sealed class Result<out T> {
object Idle : Result<Nothing>()
object Loading : Result<Nothing>()
data class Error(val error: Throwable) : Result<Nothing>()
data class Success<T>(val data: T) : Result<T>()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment