Orhan Tozan
09/05/2020, 5:38 PMTimo Drick
09/05/2020, 5:40 PMOrhan Tozan
09/05/2020, 5:41 PMTimo Drick
09/05/2020, 5:42 PMOrhan Tozan
09/05/2020, 5:42 PMTimo Drick
09/05/2020, 5:44 PMOrhan Tozan
09/05/2020, 5:45 PMromainguy
09/05/2020, 5:46 PMTimo Drick
09/05/2020, 5:46 PMromainguy
09/05/2020, 5:47 PMAdam Powell
09/05/2020, 6:03 PMremember { mutableStateOf(...) }
to remember { MyStateClass() }
that uses by mutableStateOf
internally to create separate observable properties becomes weighted rather heavily towards the latterstate {}
helper for this created a hurdle that kept people juggling many state fields themselves long past when they should be grouped within an object, because they weren't comfortable with the component primitives involvedRay Ryan
09/05/2020, 7:43 PMbohregard
09/08/2020, 9:18 PMremember { MyStateClass() }
?Adam Powell
09/08/2020, 9:33 PM@Stable class MyStateClass(
foo: Foo,
bar: Bar
) {
var foo by mutableStateOf(foo)
var bar by mutableStateOf(bar)
}
bohregard
09/08/2020, 9:35 PMAdam Powell
09/08/2020, 9:37 PM@Stable
is not required for remember, it's a signal that if you pass the same instance to a composable function that we can skip the child, since all of the object's data is observable and will notify the child if it changesbohregard
09/08/2020, 9:37 PM