TopicViewModel TopicUiState NewsUiState Result generic class #842
Unanswered
mobilekosmos
asked this question in
Q&A
Replies: 1 comment 2 replies
-
@mobilekosmos I think this is no longer the case. sealed interface TopicUiState {
data class Success(val followableTopic: FollowableTopic) : TopicUiState
object Error : TopicUiState
object Loading : TopicUiState
}
sealed interface NewsUiState {
data class Success(val news: List<UserNewsResource>) : NewsUiState
object Error : NewsUiState
object Loading : NewsUiState
} I think you close this discussion 👍 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all, just wondering why you are using a separate UiState for each screen like TopicUiState and NewsUiState when they all share the same properties, I suppose you could use the more generic class Result or another more generic class using generics? Just trying to understand if there are specific reasons why using explicit sealed class for each screen.
Beta Was this translation helpful? Give feedback.
All reactions