chore(core): cleanup

This commit is contained in:
braks
2023-11-08 08:27:12 +01:00
committed by Braks
parent 7cc798adae
commit 75cb0c9b1e
2 changed files with 6 additions and 6 deletions
@@ -15,9 +15,9 @@ const {
...props
} = defineProps<HandleProps>()
const type = toRef(props, 'type', 'source')
const type = toRef(() => props.type ?? 'source')
const isValidConnection = toRef(props, 'isValidConnection', undefined)
const isValidConnection = toRef(() => props.isValidConnection ?? null)
const {
connectionStartHandle,
@@ -1,4 +1,4 @@
import type { ToRefs } from 'vue'
import type { Ref, ToRefs } from 'vue'
import { effectScope, nextTick, onScopeDispose, toRef, watch } from 'vue'
import type { WatchPausableReturn } from '@vueuse/core'
import { watchPausable } from '@vueuse/core'
@@ -287,15 +287,15 @@ export function useWatchProps(
Object.keys(props).forEach((prop) => {
if (!skip.includes(prop as keyof typeof props)) {
const model = toRef(props, prop as keyof typeof props)
const storedValue = store[prop as keyof typeof store] as typeof model
const model = toRef(() => prop)
const storeRef = store[prop as keyof typeof store] as typeof model as Ref<any>
scope.run(() => {
watch(
model,
(nextValue) => {
if (isDef(nextValue)) {
storedValue.value = nextValue
storeRef.value = nextValue
}
},
{ flush: 'pre' },