-
Notifications
You must be signed in to change notification settings - Fork 1
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: allow updating cache entries using a predicate function #56
Conversation
4b99c20
to
bf00472
Compare
🎉 This PR is included in version 4.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Mainly wondering if this wasn't a breaking change.
/* istanbul ignore next */ | ||
return false; | ||
} | ||
const payloadInKey = keyPrefix ? queryKey[1] : queryKey[0]; |
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.
The code was a little harder to follow now - maybe a good doc comment above the line 51 would help parse this a bit quicker.
keyPrefix, | ||
createQueryKey(name, route, payloadOrPredicate), | ||
].filter(Boolean), | ||
exact: true, |
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 did we need exact now, when we didn't have it before?
Motivation
I'd like to be able to provide a predicate for updating cache entries, to allow updating all cache entries for an endpoint that match a particular pattern.