Open th3l0g4n opened 2 weeks ago
It would be great if the cache method could return an event with wich it would be possible to set cache data directly. This should work the same way how tanStackQuery.setQueryData works.
cache
tanStackQuery.setQueryData
For Example:
const customerQuery = createQuery(...) const { setCacheData } = cache(customerQuery, ...) customerQuery.$data // { firstname: 'John', lastname: 'Doe' } setCacheData({ firstname: 'John', lastname: 'Malkovich' }) customerQuery.$data // { firstname: 'John', lastname: 'Malkovich' } <-- $data reflects updated cache
It would be great if the
cache
method could return an event with wich it would be possible to set cache data directly. This should work the same way howtanStackQuery.setQueryData
works.For Example: