-
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
feat: mutate filter #1989
feat: mutate filter #1989
Conversation
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 dcda636:
|
* chore: change internalMutate type * chore: useoverload for internal mutate
(I think there’s still one last blocker which is to make useSWRInfinite work properly) |
OK this is more like a general problem today, need to think deeper about it. Meanwhile this PR can be shipped! |
Closes #1946.
Description
The global
mutate
API (imported directly from SWR or returned byuseSWRConfig
) can now accept a filter function, to match multiple keys for mutating:Breaking Changes
Cache
interface now requires akeys()
method that returns all keys in the cache object, similar to the JavaScriptMap
instances.Usage
(See #1946)