File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
packages/core/src/composables Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ import { useVueFlow } from './useVueFlow'
9
9
10
10
interface UseHandleConnectionsParams {
11
11
type : MaybeRefOrGetter < HandleType >
12
- id ?: MaybeRefOrGetter < string | undefined >
13
- nodeId ?: MaybeRefOrGetter < string | undefined >
12
+ id ?: MaybeRefOrGetter < string | null >
13
+ nodeId ?: MaybeRefOrGetter < string | null >
14
14
onConnect ?: ( connections : Connection [ ] ) => void
15
15
onDisconnect ?: ( connections : Connection [ ] ) => void
16
16
}
@@ -35,13 +35,19 @@ export function useHandleConnections({
35
35
onDisconnect,
36
36
} : UseHandleConnectionsParams ) : ComputedRef < Connection [ ] > {
37
37
const { connectionLookup } = useVueFlow ( )
38
+
38
39
const _nodeId = useNodeId ( )
39
- const currentNodeId = toRef ( ( ) => toValue ( nodeId ) || _nodeId )
40
+
41
+ const currentNodeId = toRef ( ( ) => toValue ( nodeId ) ?? _nodeId )
42
+
43
+ const handleType = toRef ( ( ) => toValue ( type ) )
44
+
45
+ const handleId = toRef ( ( ) => toValue ( id ) ?? null )
40
46
41
47
const connections = ref < Map < string , Connection > > ( )
42
48
43
49
watch (
44
- ( ) => connectionLookup . value . get ( `${ currentNodeId . value } -${ toValue ( type ) } -${ toValue ( id ) } ` ) ,
50
+ ( ) => connectionLookup . value . get ( `${ currentNodeId . value } -${ handleType . value } -${ handleId . value } ` ) ,
45
51
( nextConnections ) => {
46
52
if ( areConnectionMapsEqual ( connections . value , nextConnections ) ) {
47
53
return
You can’t perform that action at this time.
0 commit comments