From 57405de56610dcfaa506cb95e557a7c7e4d693a7 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Tue, 8 Nov 2022 21:46:01 +0100 Subject: [PATCH] refactor: use more generic scope dispose --- packages/pinia/src/subscriptions.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/pinia/src/subscriptions.ts b/packages/pinia/src/subscriptions.ts index 6dc46bb1..876966d6 100644 --- a/packages/pinia/src/subscriptions.ts +++ b/packages/pinia/src/subscriptions.ts @@ -1,4 +1,4 @@ -import { getCurrentInstance, onUnmounted } from 'vue-demi' +import { getCurrentScope, onScopeDispose } from 'vue-demi' import { _Method } from './types' export const noop = () => {} @@ -19,8 +19,8 @@ export function addSubscription( } } - if (!detached && getCurrentInstance()) { - onUnmounted(removeSubscription) + if (!detached && getCurrentScope()) { + onScopeDispose(removeSubscription) } return removeSubscription -- 2.47.3