I'm looking at a compose library for dialog, and i...
# compose
g
I'm looking at a compose library for dialog, and it's got bits of code like
content: @Composable MaterialDialog.() -> Unit
and
this@MaterialDialog.content()
Is this stuff a Kotlinism or a Composism or something else completely? Can anyone link me to something describing what these things are doing here? I think it's saying content will be a lambda/function callable on MaterialDialog? But I'd like to read a bit more about it
a
https://kotlinlang.org/docs/lambdas.html#function-types
Function types can optionally have an additional receiver type, which is specified before a dot in the notation: the type A.(B) -> C represents functions that can be called on a receiver object of A with a parameter of B and return a value of C. Function literals with receiver are often used along with these types.
g
❤️
Thanks!!