Skip to content

Instantly share code, notes, and snippets.

@rubenquadros
Last active August 18, 2021 20:58
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 rubenquadros/6f96129e7a05911960c013e8138210a0 to your computer and use it in GitHub Desktop.
Save rubenquadros/6f96129e7a05911960c013e8138210a0 to your computer and use it in GitHub Desktop.
Home view model with paging data stream
class HomeViewModel(private val gamesSource: GamesSource) :
ViewModel() {
fun getAllGames(): Flow<PagingData<GameResultsEntity>> {
return Pager(PagingConfig(50)) { gamesSource }.flow
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment