Skip to content

Instantly share code, notes, and snippets.

@GuilhE
Last active January 26, 2021 10:36
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 GuilhE/06522e57b67e097af18a8bd3cb052be6 to your computer and use it in GitHub Desktop.
Save GuilhE/06522e57b67e097af18a8bd3cb052be6 to your computer and use it in GitHub Desktop.
Medium article - UserStatus
sealed class UserStatus<out T : Any> {
class Success(val data: UserData) : UserStatus<UserData>()
object NoAccount : UserStatus<Unit>()
sealed class Error(val e: Exception) : UserStatus<Nothing>() {
class Generic(e: Exception) : Error(e)
class Error1(e: Exception) : Error(e)
class Error2(e: Exception) : Error(e)
class Error3(e: Exception) : Error(e)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment