docs(preact-query): inline 'useQuery''s basic-example options instead of a 'queryOptions' factory - #11331
Conversation
…of a 'queryOptions' factory
|
View your CI Pipeline Execution ↗ for commit 47fe85f
☁️ Nx Cloud last updated this comment at |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe PR updates Preact ChangesPreact
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This PR only standardizes the 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Title checkExplanation The title clearly describes the primary documentation change: replacing the basic Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🚀 Changeset Version PreviewNo changeset entries found. Merging this PR will not cause a version bump for any packages. |
size-limit report 📦
|
🎯 Changes
useQuery.ts's second and third overloads each opened with a basic-query example that wrapped its options in aqueryOptionsfactory (const postsOptions = queryOptions({...})) even though nothing about the example needs that — no imperative call site shares the cache entry, unlike the file's hover-prefetch example where the factory is required. The very next example in each overload ("The same query, checkingisPending/isErrorinstead ofstatus") already used an inline options object for the identical scenario, so the two adjacent examples disagreed on style for no functional reason.Inlined both basic examples' options to match.
queryOptions.ts/infiniteQueryOptions.tsthemselves, anduseQuery.ts's/useInfiniteQuery.ts's hover-prefetch examples, are unaffected — those genuinely need the factory to share a cache entry between a hook and an imperative API call. CheckeduseSuspenseQuery.ts,useSuspenseInfiniteQuery.ts,useSuspenseQueries.ts,useInfiniteQuery.ts, anduseMutation.tsfor the same inconsistency: none call their options factory outside of a cache-sharing example (useInfiniteQuery.ts's only factory use is its own hover-prefetch example; the other four don't call their factory at all), so no other file needed this change.Regenerated the corresponding reference docs with
pnpm run generate-docs.✅ Checklist
pnpm run test:pr, or these tests do not apply to this pull request.🚀 Release Impact
Summary by CodeRabbit
useQueryusage examples by showing query options inline.useQuerydocumentation.useQueryoverloads.