UseNodeConnectionsParams
The options object accepted by the
useNodeConnections() composable. Every field
is optional; each may be a value, ref, or getter. Filter by handle with handleType
(and handleId), and react to changes with onConnect / onDisconnect.
Type
type UseNodeConnectionsParams = {
// node id — defaults to the useNodeId context injection
id?: MaybeRefOrGetter<string | null | undefined>;
// called when a connection to this node is created
onConnect?: (connections: NodeConnection[]) => void;
// called when a connection to this node is removed
onDisconnect?: (connections: NodeConnection[]) => void;
// 'source' or 'target' — restrict to connections on that side
handleType?: MaybeRefOrGetter<HandleType | null | undefined>;
// a specific handle id (only for nodes with multiple same-type handles); requires handleType
handleId?: MaybeRefOrGetter<string | null | undefined>;
};Notes
handleIdrequireshandleTypeto be set.- The callbacks receive an array of
NodeConnection;handleTypeis'source'or'target'.
Last updated on