Replies: 1 comment 2 replies
-
RTKQ doesn't know anything about the contents of a given cache entry - it just knows "there are N subscriptions to this cache entry with this key". So, it doesn't know that a key of So, you'd have to have the other part of the UI use the same cache entry key in order to keep reading that specific value out of the cache entry. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My UI consists of a virtual list of items on the left and a single selected item from that list on the right. The list of items on the left is loaded using a bulk query using one of the hooks, like so:
Now I would like the right side of the app to subscribe to a single item from the bulk query. RTK query supports selecting an item from another query result, but the problem is that since our list of items is virtual, when the user scrolls a different slice of data is loaded which may not include that particular item anymore. Is there a way to make a component subscribe to a specific item from a bulk query and force it to be kept available?
Beta Was this translation helpful? Give feedback.
All reactions