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

carbaj0

04/25/2020, 5:52 PM
The dev09 don't allow delegation in
state
, there is some special technical reason?
l

Louis Pullen-Freilich [G]

04/25/2020, 5:53 PM
It should, but you need to additionally import the delegate functions:
Copy code
import androidx.compose.getValue
import androidx.compose.setValue
a

Adam Powell

04/25/2020, 5:54 PM
Alt+enter in the IDE should set you up. It moved to inline delegate functions to be compatible with the kotlin 1.4 optimizations
👌 1
c

carbaj0

04/25/2020, 6:19 PM
oh, ok! now is a extension funtion
Copy code
inline operator fun <T> State<T>.getValue(thisObj: Any?, property: KProperty<*>): T = value
Thanks!
👍 1
2 Views