Regan Russell
06/03/2020, 12:19 PMoverride fun onResponse(call: Call<List<Photos?>?>, response: Response<List<Photos?>?>) {
if it is successful and I see the dataclass fully populated. What is the most elegant way of handling on Response?
SHould I pass an object in the constructor to say call a method on the passed object to populate the data?Alejandro Rios
06/03/2020, 12:25 PMSuccess
and Failure
cases?Alejandro Rios
06/03/2020, 12:27 PMsealed class Result {
data class Success(val data : List<Photos>) : Result()
data class Failure(val exception : String) : Result()
}
Alejandro Rios
06/03/2020, 12:29 PMRegan Russell
06/03/2020, 12:33 PM