Is there someway from where I can get the list of ...
# compose
m
Is there someway from where I can get the list of items in a flow of paging source within the viewModel? [Contd..]
Usually with compose, we collect paging data(in composable) from a paging source (placed inside a viewMode) So normally we wouldn't be able to get the list of items in the paging source unless we collect it. And we do this collection using collectAsLazyPagingItems
Is there anyway by which we can retrieve the list of items present in the paging flow inside of the ViewModel itself?
i
No,
PagingData
is actually a bi-directional flow of data, passing scroll events from your UI back up through the stack to incrementally load while you scroll, so it is required to be in the UI layer
👀 1
There's an open issue for a more unidirectional flow approach, but it isn't actively being worked on FWIW: https://issuetracker.google.com/issues/183495984
👍🏽 1