Created
February 3, 2020 09:43
-
-
Save lordcodes/4bf1645714e249381331368776a9ee77 to your computer and use it in GitHub Desktop.
Code for article: "The power of sealed classes in Kotlin"
This file contains hidden or 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 renderViewState(viewState: ViewState) = when (viewState) { | |
| LoadingState -> showLoadingViews() | |
| is PresentingState -> showPresentingViews(viewState.viewData) | |
| is ErrorState -> showErrorViews(viewState.message) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment