From 0199b9830134cdb6e22f13b7e95f0d78ffc3c567 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Mon, 17 Oct 2022 08:09:03 +0800 Subject: [PATCH] fix(useBluetooth): use `shallowRef` for bluetooth instance --- packages/core/useBluetooth/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core/useBluetooth/index.ts b/packages/core/useBluetooth/index.ts index 25fb88f2293..8e080223bde 100644 --- a/packages/core/useBluetooth/index.ts +++ b/packages/core/useBluetooth/index.ts @@ -1,5 +1,5 @@ import type { ComputedRef, Ref } from 'vue-demi' -import { computed, ref, watch } from 'vue-demi' +import { computed, ref, shallowRef, watch } from 'vue-demi' import { tryOnMounted, tryOnScopeDispose } from '@vueuse/shared' import type { ConfigurableNavigator } from '../_configurable' @@ -55,9 +55,9 @@ export function useBluetooth(options?: UseBluetoothOptions): UseBluetoothReturn const isSupported = useSupported(() => navigator && 'bluetooth' in navigator) - const device = ref(undefined) + const device = shallowRef(undefined) - const error = ref(null) + const error = shallowRef(null) watch(device, () => { connectToBluetoothGATTServer()