Replies: 1 comment
-
no I don't think that's possible |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using react-query to store the results of an expensive data transformation. I split the calculation into batches to avoid freezing the main thread, which makes the calculation asynchronous. I want the cached value inside react-query to expire not on a timer, but via WeakMap-like semantics. If the original data is GCed, then I want the cached transformation to be subject to GC also. Currently, I'm using a small value for
cacheTime
, but that solution is imperfect because the data may actually need to stay cached for a while – it totally depends on how the user navigates the UI.Is there a way to expire data in react-query not based on time, but based on WeakMap-like semantics?
Beta Was this translation helpful? Give feedback.
All reactions