How's the cleanest way to update the state of each...
# compose
d
How's the cleanest way to update the state of each item in a
LazyColumn
when using paging 3? 1) In the viewModel using
map { it.map { ... } }
on the pager's flow, or 2) in the
items(...) { }
block calling some kind of state machine or flow that comes with the item in the list (also injected in the Pager's
map { }
of the flow) and collecting it there to make the changes, or 3) something else?
i
Paging is based on a single source of truth (such as your database), so usually you'd want to change that. What kind of changes are you doing?
d
A broadcast receiver and a progress flow that I get from a WorkManager task. Also pressing a button in the details view might also cause a state change in the list view too
The paging is coming in from the network.
@Ian Lake do you have any suggestions for this? I tried looking all over for the sanest way to do this, I'm starting to think that I'd just need to implement my own pagination for this... but I'd rather avoid that.