Created
April 11, 2019 13:55
-
-
Save vodamiro/36ad3771a04fb591a012c135e0909c13 to your computer and use it in GitHub Desktop.
S_A_SealedClasses2.kt
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
fun handleStateChange(newState: UIState) { | |
when (newState) { | |
is LoadingState -> println("Loading ...") | |
is DataState -> println("Got data: ${newState.data}") | |
is ErrorState -> println("Error: ${newState.error.message}") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment