-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Feature/1824 transform placeholder data with select #2108
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
Feature/1824 transform placeholder data with select #2108
Conversation
add a test for placeholderDataFunction
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/tannerlinsley/react-query/6sgX1quLgqSe94HejVAF4vBvEZsV |
|
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 0f7a9e5:
|
fix structural sharing, in the options, we might also have the placeholderData function, but on the previous result, we have the correct result from the previous iteration, which we want to keep if possible
| if (typeof placeholderData !== 'undefined') { | ||
| status = 'success' | ||
| data = placeholderData | ||
| data = placeholderData as TData |
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.
not sure why I need the type assertion here - not really happy with it. placeholderData is of type TData | TQueryFnData - maybe I have the typings wrong somewhere @boschni?
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.
Think there is no way around this. If there is no select function or behavior then placeholderData should be of type TData but TS does not know if this is the case upfront
chore: add prettier to pipeline checks and include .ts files (#2205)
|
🎉 This PR is included in version 3.15.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
closes #1824