You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One feature that I like about Tanstack Query is that their equivalent for tags ("query keys") have support for arbitrary properties.
This would give us increased flexibility and granularity for invalidating tags. Imagine if we had a Posts tag type for an endpoint with an authorId query arg.
Then we could have some enhanced ergonomics for selecting which queries we want to invalidate
// All postsapiSlice.util.invalidateTags(['Posts'])// Only the posts for a specific authorapiSlice.util.invalidateTags([{type: 'Posts', authorId }])// Invalidate whatever query cache(s) a specific post belongs toapiSlice.util.invalidateTags([{type: 'Posts', id }])
One feature that I like about Tanstack Query is that their equivalent for tags ("query keys") have support for arbitrary properties.
This would give us increased flexibility and granularity for invalidating tags. Imagine if we had a
Posts
tag type for an endpoint with anauthorId
query arg.Then we could have some enhanced ergonomics for selecting which queries we want to invalidate
This could perhaps afford for some cleaner implementations addressed by abstract tag IDs or tags to support pagination.
Especially imagine if that posts endpoint was paginated:
The text was updated successfully, but these errors were encountered: