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
I'm curious about the design choice in the QueryCache class, specifically regarding storing the whole object within a property. Wouldn't using something like WeakMap be more efficient, especially in terms of garbage collection?
I noticed in the codebase there's a garbage collection timer that removes the entire object when an observer is removed, presumably during component unmounts. How do you address concerns about storing large objects in memory and effectively managing them?
I have several questions about the decision to store data inside class properties versus considering alternative options. For instance, the useSWR codebase internally utilizes WeakMap. Seeing only a class handle all this logic made me ponder your approach.
Additionally, I'm interested in understanding the limitations of the React Query store. How many objects (queries) can it hold effectively? I'm concerned about potential memory leaks, especially as objects grow in size over time, despite implementing a garbage collection timer to remove objects when observers are detached from the queryClient.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm curious about the design choice in the QueryCache class, specifically regarding storing the whole object within a property. Wouldn't using something like WeakMap be more efficient, especially in terms of garbage collection?
I noticed in the codebase there's a garbage collection timer that removes the entire object when an observer is removed, presumably during component unmounts. How do you address concerns about storing large objects in memory and effectively managing them?
I have several questions about the decision to store data inside class properties versus considering alternative options. For instance, the useSWR codebase internally utilizes WeakMap. Seeing only a class handle all this logic made me ponder your approach.
Additionally, I'm interested in understanding the limitations of the React Query store. How many objects (queries) can it hold effectively? I'm concerned about potential memory leaks, especially as objects grow in size over time, despite implementing a garbage collection timer to remove objects when observers are detached from the queryClient.
Beta Was this translation helpful? Give feedback.
All reactions