Closed
Description
In SWR, each resource has its own states such as data
, error
, and isValidating
. And that list is expected to grow with more meta information in the future. updatedAt
(#1703) is a good example, as well as createdAt
, status
(#1215), isMutated
(#1316).
Currently we are storing each state separately with a specific key (derived from the original key) in the cache, which is poorly designed and not very extendable. Instead, we can hold all states in one object in the cache, keyed by the original resource key.
This will be a breaking change for those who directly reads from the cache.