https://kotlinlang.org logo
m

molikto

03/22/2020, 9:43 AM
I've found various cases positional memorization is the "wrong" recompose method, and I actually need a destructive update. Any suggestions better ways to handle this?
z

Zach Klippenstein (he/him) [MOD]

03/22/2020, 4:22 PM
Why do you need a destructive update, what are you actually trying to do? How does
counted.value
change over time (is it monotonically increasing/decreasing)? Have you tried using
@Pivotal
or
key
? https://developer.android.com/reference/kotlin/androidx/compose/Pivotal https://developer.android.com/reference/kotlin/androidx/compose/package-summary#key(androidx.compose.key.V1,%20kotlin.Function0)
l

Leland Richardson [G]

03/22/2020, 5:28 PM
@molikto i’d like to understand what it is that you’re wanting/needing? it sounds to me like
key
might be what you want, but not sure until i know more about the scenario you have
m

molikto

03/23/2020, 3:52 AM
@Zach Klippenstein (he/him) [MOD] @Leland Richardson [G] thanks!
key
is exactly what I needed
2 Views