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.