Skip to content

Instantly share code, notes, and snippets.

@StylingAndroid
Created April 19, 2019 15:22
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 StylingAndroid/922cc3c0b21c56aca4195ba9c777cb0d to your computer and use it in GitHub Desktop.
Save StylingAndroid/922cc3c0b21c56aca4195ba9c777cb0d to your computer and use it in GitHub Desktop.
fun main() {
myFunc(true, ::doSomething)
}
fun doSomething() {
println("Hello, world!!!")
}
fun myFunc(someCondition: Boolean, funcRef: () -> Unit) {
if (someCondition) {
funcRef()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment