Skip to Content
Vue Flow v2 is here and joins xyflow! Read more here →
ReferenceComposables

useNodeConnections()

Source on GitHub 

The useNodeConnections composable returns the connections of a node, optionally filtered by handle type (source / target) and handle id. It can also run onConnect / onDisconnect callbacks as connections come and go. Inside a custom node the id defaults to the current node.

<script setup lang="ts"> import { useNodeConnections } from '@xyflow/vue'; const connections = useNodeConnections({ handleType: 'target' }); // connections.value -> NodeConnection[] </script>

Signature

Parameters:
NameTypeDefault
paramsUseNodeConnectionsParams
Returns:
ComputedRef<NodeConnection[]>

An array of connections

Notes

  • The parameters are reactive (each accepts a ref or getter). Passing handleId requires handleType.
  • Returns a computed ref to an array of connections.