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.current.length} incoming connections!</div>Signature
Parameters:| Name | Type | Default |
|---|---|---|
params | () => UseNodeConnectionsParamsA function that returns the hook parameters |
An array with connections
| Name | Type |
|---|---|
current | NodeConnection[] |