T
TanStack11mo ago
correct-apricot

Is it possible to detect when a query becomes "inactive"?

I need to perform a specific "cleanup" action when a query is inactive (ideally also when it's garbage collected). Is there a convention to track these states?
2 Replies
other-emerald
other-emerald11mo ago
Perhaps some combination of subscribe and find on the QueryCache: https://tanstack.com/query/latest/docs/reference/QueryCache#querycachesubscribe
TanStack | High Quality Open-Source Software for Web Developers
Headless, type-safe, powerful utilities for complex workflows like Data Management, Data Visualization, Charts, Tables, and UI Components.
From An unknown user
From An unknown user
correct-apricot
correct-apricotOP11mo ago
Thanks

Did you find this page helpful?