Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why it is loading multiple page at start ?? #1

Open
razi3742 opened this issue Sep 12, 2022 · 1 comment
Open

Why it is loading multiple page at start ?? #1

razi3742 opened this issue Sep 12, 2022 · 1 comment

Comments

@razi3742
Copy link

Hello,

first of all thanks for this awsome work. can you please tell me why in RemoteMediator it is calling multiple page at once.
how we can restrict paging library to load only first page and then we have scroll to bottom then i can next page ??

@rafsanahmad
Copy link
Owner

In GithubRemoteMediator.kt

Try changing:

override suspend fun initialize(): InitializeAction {
        return InitializeAction.LAUNCH_INITIAL_REFRESH
    }

Use:
return InitializeAction.SKIP_INITIAL_REFRESH

InitializeAction used to control whether load with load type REFRESH will be immediately dispatched when the first PagingData is submitted:

Documentation: https://developer.android.com/reference/kotlin/androidx/paging/RemoteMediator#initialize()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants