What is pagesize in Pagingconfig in android

1.1k views Asked by At
fun getList() : Flow<PagingData<Store>>{
        return Pager(config = PagingConfig(pageSize = 1),pagingSourceFactory = {MyListPagingSource(service)}).flow.cachedIn(viewModelScope)
    }

Can anyone tell me what is page size refering to here

1

There are 1 answers

1
Abbas On BEST ANSWER

When making a paginated request, among other known parameters is the pageSize parameter. Which describes the length of the response you are expecting from your back-end server. However, this length is not in terms of characters, but instead the number of records the server should send you while making that request.

So, a listing request for posts with page size 10 would only fetch 10, instead of the possibly millions of posts.

Just a Note: You generally keep your pageSize to 100s not 1 or 10s.