useNodeConnections()
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:| Name | Type | Default |
|---|---|---|
params | UseNodeConnectionsParams |
Notes
- The parameters are reactive (each accepts a ref or getter). Passing
handleIdrequireshandleType. - Returns a computed ref to an array of connections.