Skip to content

Instantly share code, notes, and snippets.

@vikasmain
Created January 15, 2022 15:41
Show Gist options
  • Save vikasmain/eac3f08241f486771c38780dfc532648 to your computer and use it in GitHub Desktop.
Save vikasmain/eac3f08241f486771c38780dfc532648 to your computer and use it in GitHub Desktop.
internal fun callMoviesApi() {
movieModel.callMoviesApi()
.onStart {
movieView.showLoadingView()
}
.catch {
movieView.showErrorView()
}
.onEach {
movieView.showMoviesList(it)
}
.onCompletion {
movieView.hideLoadingView()
}
.launchIn(scope)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment