docs(query-core): add JSDoc for Subscribable and Removable base classes 🤖🤖🤖 - #11467
docs(query-core): add JSDoc for Subscribable and Removable base classes 🤖🤖🤖#11467pengzh1 wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced 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. 📝 WalkthroughWalkthroughThis change adds JSDoc comments to the ChangesQuery core API documentation
Estimated code review effort: 1 (Trivial) | ~2 minutes Suggested reviewers: Merge Risk: ⚪ Minimal · up to This PR adds JSDoc for existing subscription and garbage-collection lifecycle APIs without changing runtime behavior, so it is ready to merge. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
🎯 Changes
Follow-up to #11438, which added JSDoc across
packages/query-core/srcbut left the two internal base classes untouched:subscribable.tsandremovable.tshad no JSDoc at all.Subscribable(extended byQueryCache,MutationCache,QueryObserver,MutationObserver,QueriesObserver,FocusManager, andOnlineManager): documents the class,subscribe(that it returns an unsubscribe function and is bound to the instance, with an example),hasListeners, and theonSubscribe/onUnsubscribelifecycle hooks.Removable(extended byQueryandMutation): documents the class, thegcTimefield,destroy,scheduleGc,updateGcTime(the 5 minutes /Infinityon the server default, and that it only ever raisesgcTime),clearGcTimeout, and the abstractoptionalRemove.Since
subscribe,hasListeners, anddestroyare inherited by the public classes above, these docs now show up on hover for e.g.queryCache.subscribe(...), which previously had none. Wording follows the style used in #11438.JSDoc-only change: no runtime code is modified (74 added lines, 0 removed).
Verified locally in
packages/query-core:tsc --build(no new errors),vitest(27 files / 680 tests passing), andprettier --check.✅ Checklist
pnpm run test:pr, or these tests do not apply to this pull request.🚀 Release Impact
Summary by CodeRabbit