-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
refactor(angular-query): align inject-query and inject-infinite-query implementations, refactor create-base-query #7593
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
☁️ Nx Cloud ReportCI is running/has finished running commands for commit f748ee4. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit f748ee4:
|
7305a71
to
6a89739
Compare
}) | ||
}) | ||
|
||
test('should return the correct types', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are Angular's version of the correct types test for react-query:
https://github.com/TanStack/query/blob/main/packages/react-query/src/__tests__/useQuery.test.tsx
Let me know if you want these moved to inject-query.test-d.ts
. Put them here for location consistency with other adapter tests
… + clean-up create-base-query + add query correct type tests
6a89739
to
f748ee4
Compare
The company I work for is moving from our custom query wrapper to the official one. I had some time to audit the code and refactored a bit.
Aligned the
injectQuery
andinjectInfiniteQuery
implementations. These are simpler now and refactored the queryclient to createBaseQuery closer to where it's actually used. This can be changed again once there is a new API to provide a custom queryClient to injectQuery.Had some time left to add types tests to the injectQuery tests.
Hope this is useful and that I get some more time in the future to contribute more.
Test are passing, and I've tested these changes in the examples and our company app.