Skip to content

Instantly share code, notes, and snippets.

@lammertw
Created March 8, 2021 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lammertw/7d4c20252cb3b23ea479fbeccb385122 to your computer and use it in GitHub Desktop.
Save lammertw/7d4c20252cb3b23ea479fbeccb385122 to your computer and use it in GitHub Desktop.
interface RestaurantDetailViewModel {
val output: CFlow<Output>
data class Output(
val name: String,
val priceCategory: String,
val reservations: Reservations
) {
sealed class Reservations {
object Loading: Reservations()
data class NoReservations(val text: String): Reservations()
data class ReservationList(val items: List<Reservation>): Reservations() {
data class Reservation(val id: Int, val date: String, val numberOfGuests: Int)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment