In retrofit2, Callabck just means that it goes bac...
# announcements
r
In retrofit2, Callabck just means that it goes back to
override 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?
a
what about creating a sealed class to handle the
Success
and
Failure
cases?
Copy code
sealed class Result {
    data class Success(val data : List<Photos>) : Result()
    data class Failure(val exception : String) : Result()
}
r
Thanks.