android5-1 Exercise 2: UI State Twice ================================== Example: a recipe list. Data class: data class RecipesUiState( val recipes: List = emptyList(), val isRefreshing: Boolean = false, val errorMessage: String? = null ) Sealed interface: sealed interface RecipesUiState { data object Loading : RecipesUiState data class Success(val recipes: List) : RecipesUiState data class Error(val message: String) : RecipesUiState } Which to prefer: for a list that stays visible while it refreshes, the data class (content and a refresh flag are true together). For a screen that is clearly loading, then showing, or failed, the sealed interface (impossible combinations cannot exist). Either answer is fine if reasoned. Code unrun.