Skip to content

Instantly share code, notes, and snippets.

@timusus
Created October 20, 2018 03:27
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/b167bfe36c161579180126882972eb7d to your computer and use it in GitHub Desktop.
Save timusus/b167bfe36c161579180126882972eb7d to your computer and use it in GitHub Desktop.
Sealed Class Snippet
sealed class Result<out T> {
data class Success<out T>(val data: T?) : Result<T>()
data class Failure(val error: Error) : Result<Nothing>()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment