I'm getting some data from my database like this
Pager(PagingConfig(pageSize = PAGE_SIZE)) {
songRepo.getSongs()
}.flow.cachedIn(viewModelScope)
and I collect it in the UI using collectAsLazyPagingItems()
, but whenever I navigate to another screen and I go back the data is clearing.
Is there a solution to this or I should create my own pagination without Paging?