useNodeConnections()
This hook returns an array of connections on a specific node, handle type (‘source’, ‘target’) or handle ID.
<script>
import { useNodeConnections } from '@xyflow/svelte';
const connections = useNodeConnections({ handleType: 'target', handleId: 'my-handle' });
</script>
<div>There are currently {connections.length} incoming connections!</div>Signature
Parameters:| Name | Type | Default |
|---|---|---|
[0]?.id | string | |
[0]?.handleType | 'source' | 'target' | |
[0]?.handleId | string | |
[0]?.onConnect | (connections: HandleConnection[]) => void | |
[0]?.onDisconnect | (connections: HandleConnection[]) => void |
An array with connections
| Name | Type |
|---|---|
current | NodeConnection[] |
Last updated on