Replies: 1 comment
-
I've thought about this as well. for query/packages/query-core/src/utils.ts Lines 282 to 287 in f9ebf9a I'd accept a PR that does this with proper documentation for the use-case. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
Does ReactQuery have an officially sanctioned way to use the same internal mechanism the library does to compare queryKeys? I've had a need for this a few times over the year or so I've used RQ - particularly when building my own query matching logic for the
predicate
query filter.After a little digging, it seems that this snippet here is what I'm looking for, but is not an available import (because it's not listed in the top-level package.json exports field).
An example usecase: Say you have a multi-tenant app like Stripe where you have one Account that you log in with but also have ownership of many different projects and can view those one at a time. When you switch between those projects, you may want to clear the cache of all the queries related to the previous project but keep the high-level stuff like your Account query and the list of projects. So:
Beta Was this translation helpful? Give feedback.
All reactions