electrolobzik
01/03/2024, 12:51 PMmutableStateOf
by default the structuralEqualityPolicy
is used to find changes. But what policy is used for parameters passed to the Composable function? Are they compared by value of by reference?Chuck Jazdzewski [G]
01/03/2024, 5:43 PMstructuralEqualityPolicy
affects whether the state is considered modified when a new value is assigned to it. Assigning a new value to a state will cause it to eventually be sent to all snapshot apply listeners which, the Recomposer
being one, will invalidate the parts of the composition (if any) that read the state object and schedule the composition to be recomposed (hence the name).shikasd
01/03/2024, 7:56 PM==
for stable parameters and ===
for function references (because their equals implementation is weird).
With strong skipping, Compose uses ===
for unstable parameters, making more functions skippable.electrolobzik
01/03/2024, 8:22 PMelectrolobzik
01/03/2024, 8:23 PMelectrolobzik
01/03/2024, 8:24 PM==
to decide if recomposition is needed, right? My question was how changes in the function parameters are checked.shikasd
01/03/2024, 8:30 PMelectrolobzik
01/03/2024, 8:31 PMelectrolobzik
01/03/2024, 8:44 PMImmutable
?shikasd
01/04/2024, 5:11 PM