Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pencelab/e40b26a9ed741b8b46bfe811ea0b73f7 to your computer and use it in GitHub Desktop.
Save pencelab/e40b26a9ed741b8b46bfe811ea0b73f7 to your computer and use it in GitHub Desktop.
suspend fun loadItems() = withContext(Dispatchers.Main) {
showLoadingView()
val data = withContext(Dispatchers.IO) {
requestData()
}
hideLoadingView()
appendItemsToListView(data)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment