Skip to content

Instantly share code, notes, and snippets.

@mayojava
Last active October 9, 2018 18:47
Show Gist options
  • Save mayojava/287c8bdca9f647786416d8bf81fa3fb9 to your computer and use it in GitHub Desktop.
Save mayojava/287c8bdca9f647786416d8bf81fa3fb9 to your computer and use it in GitHub Desktop.
Shows a function that calls two asynchronous functions to login in a user and fetch list of orders
fun showUserOrders(username: String, password: String) {
val user = login(username, password)
val orders = fetchUserOrders(user.userId)
showUserOrders(orders)
}
fun login(username: String, password: String) { }
fun fetchUserOrders(userId: Long) { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment