You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Automatically subscribe/unsubscribe from TanStack Query based on collection subscriber count (#462)
* Automatically subscribe/unsubscribe from TanStack Query
When a collection backed by a TanStack Query has no active subscribers,
automatically unsubscribe from the query.
* fix types during build
* Add changeset for staleTime bug fix
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* Clarify startSync JSDoc to explain pause/resume behavior
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
---------
Co-authored-by: Sam Willis <[email protected]>
Co-authored-by: Kyle Mathews <[email protected]>
Co-authored-by: Claude <[email protected]>
Fix `staleTime` behavior by automatically subscribing/unsubscribing from TanStack Query based on collection subscriber count.
6
+
7
+
Previously, query collections kept a QueryObserver permanently subscribed, which broke TanStack Query's `staleTime` and window-focus refetch behavior. Now the QueryObserver properly goes inactive when the collection has no subscribers, restoring normal `staleTime`/`gcTime` semantics.
0 commit comments