Skip to content

Instantly share code, notes, and snippets.

Created June 8, 2023 04:41
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
suspend api single call
@Inject lateinit var suspendApi: SuspendApi
shownScope.launch {
val result = suspendApi.getCategorizedAssetsSearch(searchStr, assetCategory?.categoryIdentifier)
when (result) {
is ApiResult.Success -> {
is ApiResult.Failure -> toaster.showShortErrorToast("api error ${result.code}")
is ApiResult.NetworkError -> toaster.showShortErrorToast("network error")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment