Created
April 24, 2019 19:01
-
-
Save ValeryPonomarenko/99fe1a1383f72a7c76e4db1e6f44d7b7 to your computer and use it in GitHub Desktop.
DestinationViewStateRendererPicker
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
class DestinationViewStateRendererPicker : ViewStateRendererPicker<DestinationViewState> { | |
override fun pick(viewState: DestinationViewState): KClass<out ViewStateRenderer<DestinationViewState>> = | |
when { | |
viewState.query.isBlank() -> EmptyQueryViewStateRenderer::class | |
viewState.isLoading -> LoadingViewStateRenderer::class | |
viewState.destinations.isEmpty() -> EmptyViewStateRenderer::class | |
else -> RegularViewStateRenderer::class | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment