-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
enhancementNew feature or requestNew feature or requeststaletriage meIssue that needs to be triagedIssue that needs to be triaged
Description
Is there an existing issue for this?
- I have searched the existing issues
Is this a feature request for one of the samples?
- Yes, this is a specific request related to this samples repo.
Sample app
Jetcaster
Describe the problem
Jetcaster uses a sealed interface to display different states of the UI. For example:
sealed interface ScreenUiState {
data object Loading : ScreenUiState
data class Error(
val errorMessage: String? = null
) : ScreenUiState
data class Ready(
/* Params here */
) : ScreenUiState
}However, this may not be the best set up UX-wise as intermediate error states would result in the entire screen showing an error vs. showing an error as part of a partially rendered screen.
Describe the solution
A possible solution would be to fold loading and error states into a single screen state data class.
data class ScreenUiState(
isLoading: Boolean,
errorMessage: String?,
/* Params here */
)Other proposals are welcome.
Additional context
See discussion in #1363 (comment)
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requeststaletriage meIssue that needs to be triagedIssue that needs to be triaged