What is the meaning of following function parameter signature onChanged: ((Int?) -> Unit)? = null?
I have a function with several parameters. One of these paramters is
private fun mySpecialFunction(
variable1: Int,
onChanged: ((Int?) -> Unit)? = null
)
Later in the function it is invoked like:
onChanged?.invoke(2)
And on the upper calling site, it is called like:
mySpecialFunction(
variable1 = 1,
onChanged = {
// do something with the number invoked above
}
)
How is this usage of onChange called in Kotlin?