From 19b0972fa4742655095e90bbaa895b870625ca8d Mon Sep 17 00:00:00 2001 From: Nicolai Moraru Date: Thu, 22 Aug 2024 18:25:17 +0300 Subject: [PATCH] fix: replace onUnmounted with onScopeDispose --- packages/vue-apollo-composable/src/util/loadingTracking.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vue-apollo-composable/src/util/loadingTracking.ts b/packages/vue-apollo-composable/src/util/loadingTracking.ts index 7b51bebb..3abb41ef 100644 --- a/packages/vue-apollo-composable/src/util/loadingTracking.ts +++ b/packages/vue-apollo-composable/src/util/loadingTracking.ts @@ -1,4 +1,4 @@ -import { Ref, watch, onUnmounted, ref, getCurrentScope, onScopeDispose } from 'vue-demi' +import { Ref, watch, ref, getCurrentScope, onScopeDispose } from 'vue-demi' import { isServer } from './env.js' import type { EffectScope } from 'vue-demi' @@ -36,7 +36,7 @@ export function getCurrentTracking () { subscriptions: ref(0), }) // Cleanup - onUnmounted(() => { + onScopeDispose(() => { globalTracking.components.delete(currentScope) }) } else {