Closed ElisePatrikainen closed 2 weeks ago
Nice catch. The funny part is that I wrote down this initially but forgot to implement it. There are cases where both, onUnmounted and onScopeDispose need to be used to work correctly. For globals like stores, the entry will never be gc collected until the key changes.
It seems that the
removeDep
function is not called in the context of a query declared with thedefineQuery
composable. More precisely, theonScopeDispose
hook seems not to be called.Not sure if it is relevant, but I noticed that the scopes are not the same for a query declared with the
useQuery
composable and thedefineQuery
composable.In the
useQuery
context:And in the
defineQuery
context:Note: I will provide later the demo of these two cases.