https://kotlinlang.org logo
#compose
Title
# compose
l

Luca Nicoletti

12/13/2019, 10:43 AM
@Composable fun onDispose(callback: () -> Unit)
will this accept a
@Composable
which actually returns a value now? Something like:
@Composable fun disposeEverything() : Boolean
?
l

Leland Richardson [G]

12/13/2019, 5:19 PM
Can you clarify? I don't understand the question...
l

Luca Nicoletti

12/13/2019, 6:27 PM
Sure:
onDispose
accept a parameter of type
() -> Unit
, and I guess many other functions as well. Now I can define any composable function to be
@Composable fun myFunc() : A
- so to have a return type different from
Unit
Would
myFunc
be accepted as the parameter inside the
onDispose
or whatever other function that has the signature with
() -> Unit
?
3 Views