Skip to content

Instantly share code, notes, and snippets.

@adityawid
Last active May 31, 2021 08:05
Show Gist options
  • Save adityawid/fe72562dcf112f9a7db32a6d34b50e03 to your computer and use it in GitHub Desktop.
Save adityawid/fe72562dcf112f9a7db32a6d34b50e03 to your computer and use it in GitHub Desktop.
interface MovieRepository {
fun getPagingFavoriteMovieLiveData(): LiveData<PagingData<Movie>>
fun getPagingFavoriteMovieFlow(): Flow<PagingData<Movie>>
}
class MovieRepositoryImpl (
private val movieLocalDataSource: MovieLocalDataSource
) : MovieRepository {
override fun getPagingFavoriteMovieLiveData(): LiveData<PagingData<Movie>> =
movieLocalDataSource.getFavMoviesasLiveData()
override fun getPagingFavoriteMovieFlow(): Flow<PagingData<Movie>> =
movieLocalDataSource.getFavMoviesasFlow()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment