Created
October 9, 2018 18:27
-
-
Save mayojava/c52e5af8803d4ca20161b1203d29e822 to your computer and use it in GitHub Desktop.
callback implementation to fetch user orders
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun showUserOrders(username: String, password: String) { | |
login(username, password) { | |
user -> fetchUserOrders(user.userId) { | |
orders -> showUserOrders(orders) | |
} | |
} | |
} | |
fun login(username: String, password: String, callback: (User) -> Unit) | |
fun fetchUserOrders(userId: Long, callback: (List<Orders>) -> Unit) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment