Created
September 19, 2022 18:12
-
-
Save ercnksgl/34674e4b767c4bfb22527255b126794f to your computer and use it in GitHub Desktop.
Sealed Result Object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.ercnksgl.sealedtest.data.network.response.ApiError | |
sealed class Result<out T : Any> { | |
data class Success<out T : Any>(val data: T) : Result<T>() | |
data class Error(val error: ApiError) : Result<Nothing>() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment