Skip to content

Instantly share code, notes, and snippets.

@varundwarkani
Created May 7, 2021 19:36
Show Gist options
  • Save varundwarkani/ac0c5ea2957135db9a807ab45c08898c to your computer and use it in GitHub Desktop.
Save varundwarkani/ac0c5ea2957135db9a807ab45c08898c to your computer and use it in GitHub Desktop.
newsViewModel!!.newsRepository.getNews(PAGE_KEY, PAGE_SIZE)
.subscribe(object : Observer<NewsAPIResponse> {
override fun onSubscribe(d: Disposable) {
Log.d(LOGGER, "onSubscribe of loadInitial")
}
override fun onNext(newsAPIResponse: NewsAPIResponse) {
Log.d(LOGGER, "onNext of loadInitial - " + newsAPIResponse.data?.size)
val news = processModelData(newsAPIResponse)
}
override fun onError(e: Throwable) {
Log.d(LOGGER, "onError of loadInitial - " + e.message)
}
override fun onComplete() {
Log.d(LOGGER, "onComplete of loadInitial")
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment