Skip to content

Instantly share code, notes, and snippets.

@Kashif-E
Last active December 6, 2021 10:38
Show Gist options
  • Save Kashif-E/6da4866fd4b901b4c83b055fa30fbf70 to your computer and use it in GitHub Desktop.
Save Kashif-E/6da4866fd4b901b4c83b055fa30fbf70 to your computer and use it in GitHub Desktop.
sealed class Resource<T>(
val data: T? = null,
val error : String = ":
) {
class Success<T>(data: T?) : Resource<T>(data)
class Loading<T> : Resource<T>()
class Error<T>(messages: String):Resource<T>(error = messages)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment