Created
November 4, 2018 17:44
-
-
Save myeonginwoo/aa6c8c2f5827f00ee4953c6853cae88e to your computer and use it in GitHub Desktop.
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
// before | |
sealed class NetworkState { | |
class Init : NetworkState() | |
class Loading : NetworkState() | |
class Success(val item: Item) : NetworkState() | |
class Error(val throwable: Throwable?) : NetworkState() | |
} | |
// after | |
sealed class NetworkState<out T> { | |
class Init : NetworkState<Nothing>() | |
class Loading : NetworkState<Nothing>() | |
class Success<out T>(val item: T) : NetworkState<T>() | |
class Error(val throwable: Throwable?) : NetworkState<Nothing>() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment