From b834f2742e34a17ef7d5ea2724256daf278645f6 Mon Sep 17 00:00:00 2001 From: Fran Dios Date: Fri, 16 Oct 2020 00:26:38 +0900 Subject: [PATCH] refactor(useSubscription): use nextTick to support Vue 3 (#1045) Remove direct reference to Vue --- packages/vue-apollo-composable/src/useSubscription.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/vue-apollo-composable/src/useSubscription.ts b/packages/vue-apollo-composable/src/useSubscription.ts index 4b78f49..f4da47a 100644 --- a/packages/vue-apollo-composable/src/useSubscription.ts +++ b/packages/vue-apollo-composable/src/useSubscription.ts @@ -1,6 +1,5 @@ import { DocumentNode } from 'graphql' -import Vue from 'vue' -import { Ref, ref, watch, isRef, computed, getCurrentInstance, onBeforeUnmount } from 'vue-demi' +import { Ref, ref, watch, isRef, computed, getCurrentInstance, onBeforeUnmount, nextTick } from 'vue-demi' import { OperationVariables, SubscriptionOptions } from 'apollo-client' import { Observable, Subscription } from 'apollo-client/util/Observable' import { FetchResult } from 'apollo-link' @@ -169,7 +168,7 @@ export function useSubscription < function baseRestart () { if (!started || restarting) return restarting = true - Vue.nextTick(() => { + nextTick(() => { if (started) { stop() start()