Last active
August 18, 2021 20:58
-
-
Save rubenquadros/6f96129e7a05911960c013e8138210a0 to your computer and use it in GitHub Desktop.
Home view model with paging data stream
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
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