Skip to content

Commit

Permalink
fix(useBluetooth): use shallowRef for bluetooth instance
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Oct 17, 2022
1 parent 8c1ba50 commit 0199b98
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions 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'

Expand Down Expand Up @@ -55,9 +55,9 @@ export function useBluetooth(options?: UseBluetoothOptions): UseBluetoothReturn

const isSupported = useSupported(() => navigator && 'bluetooth' in navigator)

const device = ref<undefined | BluetoothDevice>(undefined)
const device = shallowRef<undefined | BluetoothDevice>(undefined)

const error = ref<unknown | null>(null)
const error = shallowRef<unknown | null>(null)

watch(device, () => {
connectToBluetoothGATTServer()
Expand Down

0 comments on commit 0199b98

Please sign in to comment.