How to pass meta data along with paged list using Paging 3 library

Viewed 122

I am using Android Paging 3 beta library to load the paginated list in recycler view and using MVVM architecture.

I need to pass additional meta data like the common info about the page to the view but the PagingSource.LoadResult.Page is designed in a way to return only the list of items to the view.

Here are few options which I thought about:

  • Using a live data to pass the meta data independently
  • Reading the meta data directly from the database or In Memory Cache

What would be the best approach? Any other better suggestions?

0 Answers
Related