Skip to Content
You are viewing the v1 docs of Svelte Flow. You can find the latest version here.
ReferenceHooks

useNodeConnections()

Source on GitHub 

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:
NameTypeDefault
__0UseNodeConnectionsParams

node id - optional if called inside a custom node

Returns:

An array with connections

NameType
currentNodeConnection[]
Last updated on