Skip to content

Instantly share code, notes, and snippets.

@faizul14
Created February 8, 2024 02:03
Show Gist options
  • Save faizul14/8cc7154903aaa8ffd8fc8ad0b7b10a7c to your computer and use it in GitHub Desktop.
Save faizul14/8cc7154903aaa8ffd8fc8ad0b7b10a7c to your computer and use it in GitHub Desktop.
sealed class Resource<T>(val data: T? = null, val message: String? = null) {
class Success<T>(data: T) : Resource<T>(data)
class Loading<T>(data: T? = null) : Resource<T>(data)
class Error<T>(message: String, data: T? = null) : Resource<T>(data, message)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment