Skip to content

Instantly share code, notes, and snippets.

@aymenjegham
Created December 11, 2022 20:00
Show Gist options
  • Save aymenjegham/b1dfd2d97199ecdb934250fe76b68c61 to your computer and use it in GitHub Desktop.
Save aymenjegham/b1dfd2d97199ecdb934250fe76b68c61 to your computer and use it in GitHub Desktop.
sealed class NetworkResult<T>(
val data: T? = null,
val message: String? = null
) {
class Success<T>(data: T) : NetworkResult<T>(data)
class Error<T>(message: String?, data: T? = null) : NetworkResult<T>(data, message)
class Loading<T> : NetworkResult<T>()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment