Kazemihabib199605/13/2020, 2:26 PM
? what's the benefit of using
for example uses that instead of
Adam Powell05/13/2020, 2:37 PM
has lower overhead but if it ever changes in place, we will invalidate and recompose the entire subhierarchy below the
where it changed, since we don't track precise location of reads for static ambients.
that holds the "real" value of the ambient
instance from the
in the composition stays constant and never changes, only the observable value changes when you provide a new value for the ambient key.
Kazemihabib199605/13/2020, 2:47 PM
as in most applications developers set that one time and won't change it later?
Chuck Jazdzewski [G]05/13/2020, 4:39 PM
for ambients that are unlikely to ever change or if they do change they likely invalidate the entire tree anyway. Here, change is defined as changing the value provided at the point it is provided. If a static ambient is re-provided, it is not counted as being changed and will not invalidate the tree below it, the tree below just sees a different value than the tree above.