Last active
January 25, 2019 21:25
-
-
Save navi25/538d179bd6635949efc1fc22485fd744 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
class MovieRepository(private val api : TmdbApi) : BaseRepository() { | |
fun getPopularMovies() : MutableList<TmdbMovie>?{ | |
//safeApiCall is defined in BaseRepository.kt (https://gist.github.com/navi25/67176730f5595b3f1fb5095062a92f15) | |
val movieResponse = safeApiCall( | |
call = {api.getPopularMovie().await()}, | |
errorMessage = "Error Fetching Popular Movies" | |
) | |
return movieResponse?.results.toMutableList(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment