Increase page size to improve load speed

This commit is contained in:
Kirill Kamakin
2022-11-13 14:58:04 +01:00
parent 7361ddc977
commit a638133621

View File

@@ -25,7 +25,7 @@ class RecipeRepoImpl @Inject constructor(
override fun createPager(): Pager<Int, RecipeSummaryEntity> {
logger.v { "createPager() called" }
val pagingConfig = PagingConfig(pageSize = 5, enablePlaceholders = true)
val pagingConfig = PagingConfig(pageSize = LOAD_PAGE_SIZE, enablePlaceholders = true)
return Pager(
config = pagingConfig,
remoteMediator = mediator,
@@ -58,4 +58,8 @@ class RecipeRepoImpl @Inject constructor(
logger.v { "updateNameQuery() called with: name = $name" }
pagingSourceFactory.setQuery(name)
}
companion object {
private const val LOAD_PAGE_SIZE = 50
}
}