-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 request: Please add partial matching for mutation keys #761
Comments
I have a similar situation. I'm using multiple SWRInfinites for page handling and in various configurations which hold different datasets. When certain data is updated, some of these should revalidate their data. It would be nice to revalidate/invalidate partial keys like |
Same! In my case I |
There is a swr-mutate-many package that might help. |
@RaddishIoW Hey, how do you use it? I tried |
@nimabrownlee Here is another way to mutate keys matching a regex:
|
Hmmm... All I do to force a re-fetch is to call |
We're working on the doc for There's a example section for partial mutation in that PR, feel free to give a try with |
Docuement and examples are landed in cache docs |
The above link is out of date, this is the new one https://swr.vercel.app/docs/advanced/cache |
What about composite keys? useSwr({url, token})? |
examples #1946 |
Feature request
Description / Observed Behavior
My previous issue was completely removed for some strange reason (not even closed) so I am opening a new one. Right now if you want to use the global mutate function you have to provide a complete match with the key. It's very weird and even react-query supports partial matching. Please add it as its very crucial. I cant replicate every key in every component.
The text was updated successfully, but these errors were encountered: