Skip to content

Instantly share code, notes, and snippets.

@gastsail
Created December 21, 2019 15:54
Show Gist options
  • Save gastsail/562cad0ec0e9abbf8dc113231537878d to your computer and use it in GitHub Desktop.
Save gastsail/562cad0ec0e9abbf8dc113231537878d to your computer and use it in GitHub Desktop.
sealed class Resource<out T> {
class Loading<out T> : Resource<T>()
data class Success<out T>(val data: T) : Resource<T>()
data class Failure<out T>(val throwable: Throwable) : Resource<T>()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment