Skip to content

Instantly share code, notes, and snippets.

@jordanterry
Created April 8, 2018 10:07
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 jordanterry/615a7fc492c3dceac37cf027102bac90 to your computer and use it in GitHub Desktop.
Save jordanterry/615a7fc492c3dceac37cf027102bac90 to your computer and use it in GitHub Desktop.
Use functions not single function interfaces.
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