What is the best way to prevent a function running after its fetched and not loaded.
I have data that I want to live in short term cache. After initial load, I want to run a function against that data but not run that function if the data is 'fetched' again.
2 Replies
united-yellow•2y ago
what's the function doing? Since queries are idempotent, any transformation would likely need to be done again after a refetch
manual-pinkOP•2y ago
The function is loading PDF data into a 3rd party library from the blob data returned from a useQuery.
I don't want to cache the data long term, since it could be large. I'm thinking potentially I make the stale time infinite but make the cache time small .
All good, seems like multiple ways to skin this cat. Absolutely love RQ ❤️