Skip to Content
πŸ“£ We just released Svelte Flow 1.0 Alpha β€” try it out and give us your feedback!
ReferenceHooksuseHandleConnections()

useHandleConnections()

useHandleConnections is deprecated in favor of the more capable useNodeConnections.

Source on GitHub 

This hook can be used to get notified when the connections of a handle change.

<script lang="ts"> import { useHandleConnections } from '@xyflow/svelte'; const connections = useHandleConnections({ nodeId: 'node-id', type: 'target' }); $: { // This will be called whenever connections change // for the target handle in the node with id 'node-id' console.log($connections); } </script>

Signature

#Params
#nodeId
string
#type
"source" | "target"
The type of the handle
#id(optional)
string
The id of the handle. This is only necessary if you have multiple handles of the same type.
#Returns
A readable store of the connections that are connected to this handle.

Notes

Last updated on