Pablo
04/24/2024, 12:17 PMsealed interface MarsUiState {
data class Success(val photos: String) : MarsUiState
object Error : MarsUiState
object Loading : MarsUiState
}
why they use interface instead of class? why object for Error and Loading instead of class? object is a singleton.Stylianos Gakis
04/24/2024, 12:20 PMAnselmo Alexandre
04/24/2024, 12:54 PMsealed class
, sealed interface
and `object`s. Refer to this https://kotlinlang.org/docs/sealed-classes.html#declare-a-sealed-class-or-interfaceZach Klippenstein (he/him) [MOD]
04/24/2024, 3:21 PMZach Klippenstein (he/him) [MOD]
04/24/2024, 3:23 PM