-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
refactor(react-query/useQueries): remove unreachable 'willFetch' branch in suspense promise collection #10082
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
base: main
Are you sure you want to change the base?
refactor(react-query/useQueries): remove unreachable 'willFetch' branch in suspense promise collection #10082
Conversation
…ch in suspense promise collection
|
📝 WalkthroughWalkthroughRemoved the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
|
View your CI Pipeline Execution ↗ for commit 6c4763d
☁️ Nx Cloud last updated this comment at |
🎯 Changes
Remove the unreachable
willFetchbranch inuseQueriessuspense promise collection.In v4,
useQueriesallowed individual queries to setsuspense: true/false, so a mix of suspense and non-suspense queries was possible. ThewillFetchbranch handled prefetching for non-suspense queries within a suspense batch.In v5,
suspensewas omitted fromUseQueryOptionsanduseSuspenseQueriesappliessuspense: trueto all queries uniformly. This makes the mixed suspense/non-suspense scenario unreachable through the public API, leaving thewillFetchbranch as dead code.This PR removes:
willFetchbranch (else if (willFetch(result, isRestoring)))willFetchimport from./suspense✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.