Is there someway from where I can get the list of items in a flow of paging source within the viewModel?
[Contd..]
Mahmoo
05/18/2024, 7:20 AM
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
Mahmoo
05/18/2024, 7:21 AM
Is there anyway by which we can retrieve the list of items present in the paging flow inside of the ViewModel itself?
i
Ian Lake
05/18/2024, 2:35 PM
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