Skip to content

Instantly share code, notes, and snippets.

@faizul14
Created February 8, 2024 02:04
Show Gist options
  • Save faizul14/16b6b7599354df987c6c29c0f25ffe5c to your computer and use it in GitHub Desktop.
Save faizul14/16b6b7599354df987c6c29c0f25ffe5c to your computer and use it in GitHub Desktop.
sealed class ApiResponse<out R> {
data class Success<out T>(val data: T) : ApiResponse<T>()
data class Error(val errorMessage: String) : ApiResponse<Nothing>()
object Empty : ApiResponse<Nothing>()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment