I would like to pass as an argument a function tha...
# getting-started
d
I would like to pass as an argument a function that takes 2 arguments. I know how to pass a function which just takes 1 argument:
Copy code
fun MyComposable(myEventFunctionWithOneArgument: (String) -> Unit) {
    ...
}
--------
MyComposable( { model.myEventFunctionWithOneArgument(it) } )
but how to do specify a function that takes 2 arguments?
Copy code
fun MyComposable(myEventFunctionWithTwoArguments: (String, String) -> Unit) {
    ...
}
--------
a
Copy code
MyComposable( { param1, param2 ->
	model.myEventFunctionWithTwoArguments(param1, param2) 
} )
❤️ 1
d
@alvr many thanks!