Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
MovieHunt blog part3 repo
interface MovieRepo {
fun fetchMovieList(category: MovieCategory, pageSize: Int = DEFAULT_PAGE_SIZE): Observable<PagedList<MovieModel>>
}
class MovieRepoImpl : MovieRepo, KoinComponent {
override fun fetchMovieList(
category: MovieCategory,
pageSize: Int
): Observable<PagedList<MovieModel>> {
val dataSourceFactory = MovieListDataSourceFactory(category)
val pagedListConfig = PagedList.Config.Builder()
.setPageSize(DEFAULT_PAGE_SIZE)
.setEnablePlaceholders(false)
.build()
return RxPagedListBuilder(dataSourceFactory, pagedListConfig)
.setFetchScheduler(Schedulers.io())
.buildObservable()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.