nglauber
07/05/2020, 2:58 PMA
and this composable calls B
which calls C
. Is there a way to change the state in C
? When we had @Model
we just need to update attribute and it worked…Adam Powell
07/05/2020, 3:29 PM@Model
is functionally equivalent to:
@Stable
class MyState {
var one by mutableStateOf(0)
var two by mutableStateOf("default")
private set
// ...etc
}
if you have a pattern that worked well with @Model
the above transformation will behave the same* way
*the above will update more granularly based on individual property reads and changes, whereas @Model
would update any property reader scope even if that scope only read properties that did not change.@Stable
is there for some specific skipping optimizations, presuming that all state in the object obeys the stability contract like MutableState<T>
or immutable values do. We're hoping to infer it automatically later.)nglauber
07/05/2020, 4:37 PM