https://kotlinlang.org logo
#compose
Title
# compose
u

uli

05/23/2019, 5:01 PM
Thanks for the details. What I do not quite understand is the meaning of
source location
in
unique to the source location of the call site.
in the blog, and in your explanation the meaning of
source property
in
you introduce a key that is combined with the source property to introduce a group specific key.
l

Leland Richardson [G]

05/23/2019, 5:02 PM
the compiler will create a unique integer for each call site of a composable function . This is used to automatically ensure that each call site is considered unique in the eyes of the memoization
this is important since different call-sites can have different number of parameters, and thus consult the memoization cache a different number of times, which would result in misalignment
however, sometimes you also want to track with the identity of the data or something. we introduced
Key
and
@Pivotal
to deal with this
so i can have a parameter be labeled as pivotal, which means that in addition the the source location integer being used, we will also check the parameter, and trigger moves/inserts/deletes based on that
u

uli

05/23/2019, 5:06 PM
got it. thanks
2 Views