8000 feat: add parallelLimit option to useSWRInfinite by FAL-coffee · Pull Request #4133 · vercel/swr · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: add parallelLimit option to useSWRInfinite #4133

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

FAL-coffee
Copy link

This PR adds a new parallelLimit option to useSWRInfinite. When used with the parallel option, it limits the number of concurrent fetches to the specified value, instead o 8000 f fetching all pages in parallel at once. This can help control the load on the server and improve performance for applications that need to fetch many pages.

@FAL-coffee FAL-coffee requested review from shuding and huozhi as code owners June 9, 2025 05:46
Copy link
codesandbox-ci bot commented Jun 9, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@@ -215,9 +216,22 @@ export const infinite = (<Data, Error>(useSWRNext: SWRHook) =>
}
}

// flush all revalidateions in parallel
// flush all revalidations in parallel with optional limit
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo
revalidateions → revalidations

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

Successfully merging this pull request may close these issues.

1 participant
0