-
Notifications
You must be signed in to change notification settings - Fork 0
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
(govern) feat: add possibility to reset all votes #139
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…into tanya/votes-reset
queryClient.removeQueries({ | ||
predicate: (query) => | ||
INVALIDATE_AFTER_UPDATE_KEYS.includes( | ||
(query.queryKey[1] as Record<string, string>)?.scopeKey, |
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.
what is [1]
here?
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.
}); | ||
|
||
// Reset previously saved data so it's re-fetched automatically | ||
queryClient.removeQueries({ |
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.
why not "invalidateQueries"? do we not want to refetch it?
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.
if using invalidate, afair some related useEffects won't be recalculated because saved cache will remain and just replaces with refetched data, while I needed it like the whole page was reloaded without actual reloading
TanStack/query#3169
Proposed changes
Fixes
Types of changes
What types of changes does your code introduce?
Put an
x
in the boxes that apply