boundaryCallback

Typically used to load additional data from network when paging from local storage.

Pass a BoundaryCallback to listen to when the PagedList runs out of data to load. If this method is not called, or null is passed, you will not be notified when each DataSource runs out of data to provide to its PagedList.

If you are paging from a DataSource.Factory backed by local storage, you can set a BoundaryCallback to know when there is no more information to page from local storage. This is useful to page from the network when local storage is a cache of network data.

Note that when using a BoundaryCallback with a Flow<PagedList>, method calls on the callback may be dispatched multiple times - one for each PagedList/DataSource pair. If loading network data from a BoundaryCallback, you should prevent multiple dispatches of the same method from triggering multiple simultaneous network loads.