julioromano
11/03/2023, 4:03 PMremember
some data inside a LazyList
item so that it would be retained in memory when the item scrolls in and out of the list?Konstantin Tskhovrebov
11/03/2023, 4:20 PMFrancesc
11/03/2023, 4:29 PMremember
persists data across recompositions; once your item is no longer in the composition, the remember
will be discarded. You'd have to remember this at the list scope. What's your use case?shikasd
11/03/2023, 4:37 PMrememberSaveable
kinda does this, but you probably want to move it outside of lazy list itemjulioromano
11/03/2023, 5:12 PMrememberSaveable
part was quite counterintuitive to me but it's indeed true.
Though I'd also wish to actually preserve instances of object, not just their values.shikasd
11/03/2023, 5:14 PMremember
does save stuff to slot table directly 🙂CompositionLocal
)julioromano
11/16/2023, 12:23 PMI've experimented a bit withkinda does this, but you probably want to move it outside of lazy list itemrememberSaveable
rememberSaveable
in items of a LazyColumn
. It behaves as expected initially but if the items include anything that uses a SubcomposeLayout
no state will be kept even with rememberSaveable
. Is this expected?shikasd
11/16/2023, 12:33 PM