Merge pull request #4725 from xyflow/feat/use-handle-connection
add `useNodeConnections`, deprecate `useHandleConnections`
This commit is contained in:
@@ -238,7 +238,14 @@ export function useReactFlow<NodeType extends Node = Node, EdgeType extends Edge
|
||||
Array.from(
|
||||
store
|
||||
.getState()
|
||||
.connectionLookup.get(`${nodeId}-${type}-${id ?? null}`)
|
||||
.connectionLookup.get(`${nodeId}-${type}${id ? `-${id}` : ''}`)
|
||||
?.values() ?? []
|
||||
),
|
||||
getNodeConnections: ({ type, handleId, nodeId }) =>
|
||||
Array.from(
|
||||
store
|
||||
.getState()
|
||||
.connectionLookup.get(`${nodeId}${type ? (handleId ? `-${type}-${handleId}` : `-${type}`) : ''}`)
|
||||
?.values() ?? []
|
||||
),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user