I struggle a bit with Kotlin right now.
In Java, what I'd do, is this:
public void doSomething(Consumer<String> onResult) {
...
onResult.accept("Hello");
}
Now, from what I hear, in Kotlin I go about it like this:
fun doSomething(onResult: (message: String) -> Unit) {
...
}
How to pass on a value to onResult now?
fun doSomething(onResult: (message: String) -> Unit) {
onResult.apply { "Hello" }
}
Or how to go about it?