https://kotlinlang.org logo
#codereview
Title
# codereview
o

Omar Mohamed

11/04/2018, 4:59 PM
This is the code that creates the RxNetworkDataSourceAdapter:
Copy code
private fun createNetworkDataSourceAdapter(): RxNetworkDataSourceAdapter<BeerListResponse<List<Beer>>> {
        val pageFetcher = object : RxPageFetcher<BeerListResponse<List<Beer>>> {
            override fun fetchPage(page: Int, pageSize: Int): Single<BeerListResponse<List<Beer>>> =
                remoteSource.getBeers(page = page, pageSize = pageSize)
        }
        return pageFetcher.toTotalEntityCountNetworkDataSourceAdapter()
    }