Mar 20, 2024
Thank you for the detailed article. But I believe your example for the sealed class can be used for the sealed interface since there are no constructors required.
The example showed for the sealed interface has no advantages over the normal interface
sealed interface ViewState {
object Loading : ViewState
data class Success(val data: List<Item>) : ViewState data class Error(val message: String) : ViewState
}