Skip to content

Instantly share code, notes, and snippets.

@u0705666
Created June 8, 2023 04:38
Show Gist options
  • Save u0705666/937fdcdc3360d7538398cba33a393db8 to your computer and use it in GitHub Desktop.
Save u0705666/937fdcdc3360d7538398cba33a393db8 to your computer and use it in GitHub Desktop.
rxjava-api-call-example
autoDispose(
api.getCategorizedAssetsSearch(searchStr, assetCategory?.categoryIdentifier)
.observeOn(mainThread())
.doOnSubscribe { view.showSearchLoading() }
.doOnTerminate { view.hideSearchLoading() }
.subscribe(
{
view.replaceListItems(getAssetListItem(it.categorizedAssets))
},
{
networkErrorToaster.showErrorMessage(it)
}
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment