feat(core): add getHandleConnections action (#1595)
* feat(core): add `getHandleConnections` action Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> * chore(changeset): add Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> --------- Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -72,6 +72,10 @@ export function useActions(state: State, nodeLookup: ComputedRef<NodeLookup>, ed
|
||||
return getConnectedEdgesBase(nodesOrId, state.edges)
|
||||
}
|
||||
|
||||
const getHandleConnections: Actions['getHandleConnections'] = ({ id, type, nodeId }) => {
|
||||
return Array.from(state.connectionLookup.get(`${nodeId}-${type}-${id ?? null}`)?.values() ?? [])
|
||||
}
|
||||
|
||||
const findNode: Actions['findNode'] = (id) => {
|
||||
if (!id) {
|
||||
return
|
||||
@@ -880,6 +884,7 @@ export function useActions(state: State, nodeLookup: ComputedRef<NodeLookup>, ed
|
||||
getIncomers,
|
||||
getOutgoers,
|
||||
getConnectedEdges,
|
||||
getHandleConnections,
|
||||
isNodeIntersecting,
|
||||
panBy,
|
||||
fitView: (params) => viewportHelper.value.fitView(params),
|
||||
|
||||
Reference in New Issue
Block a user