Skip to content

Instantly share code, notes, and snippets.

@skydoves
Created April 11, 2022 01:26
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 skydoves/edc5c76faa3a2b9f2343c87304990fa1 to your computer and use it in GitHub Desktop.
Save skydoves/edc5c76faa3a2b9f2343c87304990fa1 to your computer and use it in GitHub Desktop.
network_result_sealed_class
sealed class NetworkResult<T : Any> {
class Success<T: Any>(val data: T) : NetworkResult<T>()
class Error<T: Any>(val code: Int, val message: String?) : NetworkResult<T>()
class Exception<T: Any>(val e: Throwable) : NetworkResult<T>()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment