Skip to content

Instantly share code, notes, and snippets.

@felixchez
Created December 12, 2018 19:32
Show Gist options
  • Save felixchez/7a3154985b5321ff019b03c6b7c3e205 to your computer and use it in GitHub Desktop.
Save felixchez/7a3154985b5321ff019b03c6b7c3e205 to your computer and use it in GitHub Desktop.
kotlin_notnullable_function_callback
fun doAsyncOperation(val onCallback: (String) -> Unit?) {
// do lengthy computation operation
onCallback("result")
}
===
doAsyncOperation { _ -> }
doAsyncOperation {result -> Log.v(result)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment