Created
August 28, 2020 11:32
-
-
Save AniketSK/6fa22c8d0ff523217f271783191a2b5f to your computer and use it in GitHub Desktop.
A way to define a generic kotlin lce.
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
sealed class Lce<T> { | |
class Loading<T> : Lce<T>() // Can't be an object since it wouldn't have the T otherwise. | |
data class Content<T>(val data : T) : Lce<T>() | |
data class Error<T>(val error : Throwable) : Lce<T>() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment