Fudge
07/28/2020, 7:45 PMstate
but it seems like it makes it so writes to the variable somehow get ignored, so I would change the value but after the recomposition the value is the same as it was before. I can’t really give a complete example since its in a middle of a lot of things and this only happens in exactly the second instance of this state variable. But the magical nature of remember {} and such make it impossible to debug. At this point it seems it would be easier to roll out my own implementation of state.Timo Drick
07/28/2020, 8:44 PMZach Klippenstein (he/him) [MOD]
07/28/2020, 9:05 PMstate
?Fudge
07/28/2020, 9:11 PMLeland Richardson [G]
07/28/2020, 9:16 PMMutationPolicy
. The general idea here is that wherever the value
property of the state object is set, it will trigger a recomposition to all of the scopes where that property was readreferentialEqualityPolicy()
and the latter we refer to as structuralEqualityPolicy()
state
and stateFor
and instead push people towards writing remember { mutableStateOf(…) }
explicitly https://android-review.googlesource.com/c/platform/frameworks/support/+/1375120Fudge
07/29/2020, 5:17 AMLeland Richardson [G]
07/29/2020, 6:33 AMFudge
07/29/2020, 6:33 AMLeland Richardson [G]
07/29/2020, 6:34 AMFudge
07/29/2020, 8:31 AMremember{}
variables? As if I've switched back and forth to a different componentTimo Drick
07/29/2020, 10:15 AMZach Klippenstein (he/him) [MOD]
07/29/2020, 2:17 PMkey
function, which will effectively "reset" all the remembers inside it when any of its parameters change.Fudge
07/29/2020, 7:35 PMkey
works well. I can't tell if it would have solved my original problem though since things have terraformed sinced then, but maybe it would have 😅