Skip to content

Instantly share code, notes, and snippets.

@1jGabriel
Created July 19, 2020 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1jGabriel/09564a5d1ca73e76ea04091c3e5b5809 to your computer and use it in GitHub Desktop.
Save 1jGabriel/09564a5d1ca73e76ea04091c3e5b5809 to your computer and use it in GitHub Desktop.
Pager Sample
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