Created
June 26, 2018 22:20
-
-
Save hrules6872/99b007c498c919404f9961715ecbe5a7 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
fun showState(state: State) { | |
when (state) { | |
State.Loading -> println("loading") | |
is State.Content -> println("list size: ${state.list.size}") | |
is State.Error -> println("error: ${state.errorCode}") | |
State.Empty -> println("empty") | |
}.exhaustive | |
} |
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
val Any?.exhaustive: Unit | |
get() {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment