Created
July 19, 2020 15:29
-
-
Save 1jGabriel/09564a5d1ca73e76ea04091c3e5b5809 to your computer and use it in GitHub Desktop.
Pager Sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun getItems(): Flow<PagingData<MyModel>> { | |
return Pager( | |
config = PagingConfig(pageSize = 20), | |
pagingSourceFactory = { MyPagingSource(api = api) } | |
).flow.cachedIn(viewModelScope) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment