Created
March 8, 2021 17:57
-
-
Save lammertw/98d61994a3a9b39600e670ddef2329f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class Restaurant(val id: Int, val name: String, val priceCategory: String) | |
data class Reservation(val id: Int, val date: Long, val numberOfGuests: Int) | |
sealed class Response<T> { | |
class Loading<T>: Response<T>() | |
class Failed<T>: Response<T>() | |
data class Success<T>(val data: T): Response<T>() | |
} | |
interface Api { | |
fun restaurant(id: Int): Flow<Response<Restaurant>> | |
fun restaurantReservations(restaurantId: Int): Flow<Response<List<Reservation>>> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment