Created
November 8, 2019 05:49
-
-
Save herisulistiyanto/d978746082a8e5f4beb6924ac2316848 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 MovieRemoteDataSource(private val movieApiService: MovieApiService) : BaseDataSource() { | |
fun discoverAllMovies(scope: CoroutineScope): LiveData<ResponseResult<ResponseWrapper<MovieResponse>>> = resultLiveData(scope) { | |
getResult { | |
movieApiService.discoverAllMovies() | |
} | |
} | |
fun getMovieDetails(movieId: Int, scope: CoroutineScope): LiveData<ResponseResult<ResponseWrapper<MovieDetailResponse>>> = resultLiveData(scope) { | |
getResult { | |
movieApiService.getMovieDetail(movieId) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment