Skip to content

Instantly share code, notes, and snippets.

@timusus
Created October 20, 2018 03:27
Show Gist options
  • 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