Mariano Zorrilla
03/11/2020, 2:41 PMAdam Powell
03/11/2020, 2:44 PMMariano Zorrilla
03/11/2020, 2:44 PMAdam Powell
03/11/2020, 2:45 PMMariano Zorrilla
03/11/2020, 2:46 PMAdam Powell
03/11/2020, 2:47 PM@Model
which will notify compose if any of its vars change, but you're not changing one of its vars, you're changing a mutable list contained therein@Composable
from your emitter
- it doesn't need to be special, and you don't want to wrap the change in state {}
- that's for declaring a tracked MutableState<T>
and `remember {}`ing it at that point in the composition. You already have your state object and don't need to create another.Mariano Zorrilla
03/11/2020, 2:51 PMAdam Powell
03/11/2020, 2:53 PMmodelListOf
instead of mutableListOf
val
rather than a var
Mariano Zorrilla
03/11/2020, 2:55 PMZach Klippenstein (he/him) [MOD]
03/11/2020, 6:13 PMwithIndex()
on your list before passing it to AdapterList
.Mariano Zorrilla
03/11/2020, 6:20 PMAdam Powell
03/11/2020, 7:41 PMkotlinx.collections.immutable
library's PersistentList
and assign the new immutable lists to a model field or State<T>
- we use those collections internally in compose so it's not going to add any more overhead to your apk size than is already thereMariano Zorrilla
03/11/2020, 7:43 PMAdam Powell
03/11/2020, 7:45 PMRyan Mentley
03/13/2020, 8:24 AMMariano Zorrilla
04/10/2020, 2:36 PM