Created
April 8, 2018 10:07
-
-
Save jordanterry/615a7fc492c3dceac37cf027102bac90 to your computer and use it in GitHub Desktop.
Use functions not single function interfaces.
This file contains 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
interface DataCallback { | |
fun receive(data: Data) | |
} | |
val callback = object : DataCallback { | |
fun receive(data: Data) { | |
// Do something. | |
} | |
} | |
dataRepositroy.getData(callback) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment