-
-
Notifications
You must be signed in to change notification settings - Fork 100
Closed
Description
This is a call for discussion and opinion exchange.
While implementing screens with a sealed state structure like
sealed interface State {
data object Loading : State
data class Content(val userName: String, val userEmail: String) : State
}I realized that the state holds a navigation aspect in it - Loading represents one child and Content another one. The difference to the conventional navigation is that the navigation path is represented by the state and is dispatched to view as a state.
An alternative to it would be to define two navigation children, one per a sealed sub-type, and declare a flat data class state for content.
@arkivanov Do you have any opinion or thoughts on this? Are there any best practices for such sealed states?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels