Is the calculation of `currentCompositeKeyHash` ak...
# compose
u
Is the calculation of
currentCompositeKeyHash
aka
currentComposer.compoundKeyHash
well-defined?
rememberSaveable()
uses it for save keys, but if I add something like
key(objectWithDefaultHashKey)
to my Compose hierarchy then I assume the save key will be different before and after process death, and whatever I saved would not be restored, right? My particular use case has
key(enumValue)
, which I assume would also have different hash values before and after process death, based on what
Enum.hashCode()
does. Would I be in the clear then, as far as
rememberSaveable()
goes, if I used something like
key(enumValue.myStringLabel)
instead? The reason for my question is this comment from a Googler: https://issuetracker.google.com/issues/152014032#comment4
a
I think we have a special handling for enums when you put them into places like
key()
, we essentially use enum.ordinal() instead
160 Views