Matching of reactive keys not working
See original GitHub issueI will give an example to show my issue. I have a query key like this: reactive(['products', 'show', productId])
, where productId
is a Ref
. If I use setQueryData
with this key, the change is not reflected in a query that uses exactly the same key. I know the problem is the ref because if I use this key instead it works: reactive(['products', 'show', productId.value])
.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
c# - Reactive extensions: matching complex key press sequence
Save this question. Show activity on this post. What I'm trying to achieve is to handle some complex key press and release sequence...
Read more >How to Fix Windows 10 Product Key Activation Not Working
Are you having a problem getting Windows 10 to activate with your product key? Here's a look at some ways to fix the...
Read more >Reactive Forms rules for name and formControlName ... - GitHub
When using Reactive Forms and radio buttons, an error is logged indicating that the name and formControlName attributes must match, even for ...
Read more >How to Validate Angular Reactive Forms - freeCodeCamp
In this article, we will learn about validations in reactive forms in ... If the values do not match, we will set the...
Read more >How to configure Logitech Lightsync RGB lighting ... - YouTube
In this video, JC walks you through the setup and special features of Logitech's Lightsync-enabled RGB gaming peripherals, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@aantipov If we would create a wrapper for
QueryClient
we should create a wrapper forQueryCache
andMutationCache
. Not to mention react-query persistor plugins and all other hooks that we have.Nevertheless i think it is a valid concern and we could create a single utility to
deepUnref
an object/array and use it everywhere.I think that this hash function is only relevant for hooks, and it can also be set in provider via
queryClient.setDefaultOptions
.But it will not work on other functions that uses
queryKey
likequeryClient.invalidateQueries
orqueryClient.getQueriesData
. They are using partial matching and therefore require non-stringified version of the query key (Relevant piece of code).Also besides unwrapping
queryKey
we would need to unwrap options objects as well to streamline the experience if we are going this way.So either:
deepUnref
everything everywhereQueryClient
QuerueryCache
etc. user has to unwrap parameters by himself (maybe using ourdeepUnref
utility). Only hooks deal with unwrapping automatically.~Personally i would go with option 2. This would be much easier to maintain, as we would not have to track changes in the core and only care about properly working hooks. Unless there is very high demand for option 1.~
Edit: When i thought about it more creating wrappers seems like the way to go.