Created
August 3, 2018 06:58
-
-
Save sharmadhiraj/cbae4ae5d0e76b748a9c7d0690c71e00 to your computer and use it in GitHub Desktop.
Android Paging Library
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 NewsDataSourceFactory( | |
private val compositeDisposable: CompositeDisposable, | |
private val networkService: NetworkService) | |
: DataSource.Factory<Int, News>() { | |
val newsDataSourceLiveData = MutableLiveData<NewsDataSource>() | |
override fun create(): DataSource<Int, News> { | |
val newsDataSource = NewsDataSource(networkService, compositeDisposable) | |
newsDataSourceLiveData.postValue(newsDataSource) | |
return newsDataSource | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment