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
fix(useQuery): cleanup queries even if they have been fetching (TanStack#2950)
* fix(useQuery): cleanup queries even if they have been fetching
* fix(useQuery): cleanup queries even if they have been fetching
do not re-schedule garbage collection if a query is fetching and we never had any observers subscribed; this is necessary to make suspense work, because with suspense, we always throw before we subscribe, so the garbage collection would prematurely remove the query, resulting in an infinite loop
* fix(useQuery): cleanup queries even if they have been fetching
only schedule garbage collection when the last observer unsubscribes rather than in the constructor
this works around the suspense issue because we only add observers after we've loaded as we throw before that.
0 commit comments