Conversation
…onstructor' to follow Angular convention
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughTwo test cases in the injectable queries test suite were refactored to move effect initialization from standalone class field declarations into constructor methods. The effect bodies remain functionally identical, maintaining the snapshot logic for Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
View your CI Pipeline Execution ↗ for commit 2e728f2
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version PreviewNo changeset entries found. Merging this PR will not cause a version bump for any packages. |
size-limit report 📦
|
…onstructor' to follow Angular convention (TanStack#10537)
🎯 Changes
Refactors the two
effect()calls ininject-queries.test.tsfrom the class-field assignment (_ = effect(...)) pattern into an explicitconstructor()body, matching the convention used in our own Angular documentation.Before
After
Why
The Angular official signals guide explicitly calls out the constructor as the recommended place to register an
effect:The same pattern is already used in our own guide at
docs/framework/angular/guides/paginated-queries.md, so moving the tests to match keeps the codebase internally consistent._ = effect(...)works (class-field initialization is still inside an injection context), but it leaves behind a meaningless_identifier and diverges from the conventions shown in both the Angular docs and our own Angular guide.Scope
Only
inject-queries.test.tsis touched.inject-query.test.tsalso callseffect()but wraps it inTestBed.runInInjectionContext(() => effect(...))— that's a different pattern for injector-less tests and is out of scope here.Verification
@tanstack/angular-query-experimental— 208 tests passed, 0 type errorssrc/inject-queries.tscoverage unchanged (100% across Stmts/Branch/Funcs/Lines)✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit