Thread
#compose
    Fudge

    Fudge

    2 years ago
    Why are
    MutableState<T>.setValue
    /
    MutableState<T>.getValue
    extension methods instead of instance methods? This creates some confusion for me when I write
    by state{}
    and it errors, and I need to use the import quickfix.
    Zach Klippenstein (he/him) [MOD]

    Zach Klippenstein (he/him) [MOD]

    2 years ago
    https://developer.android.com/jetpack/androidx/releases/compose#0.1.0-dev09:
    [Mutable]State property delegate operators moved to extensions to support Kotlin 1.4 property delegate optimizations. Callers must add imports to continue using by state { ... } or by mutableStateOf(...). (I5312c)
    Adam Powell

    Adam Powell

    2 years ago
    Ideally we can get studio doing this in one step rather than several, but yeah, it's to benefit from the inlining in 1.4
    l

    Leland Richardson [G]

    2 years ago
    yeah, plan on the IDE doing a better job w/ this at some point
    but them being extension functions are actually pretty critical