refactor(useConnection): return internal node, add node generic

This commit is contained in:
moklick
2024-07-10 11:58:49 +02:00
parent 1e429da911
commit 6904b5bd49
8 changed files with 50 additions and 36 deletions
+2 -2
View File
@@ -104,7 +104,7 @@ function onPointerDown(
from,
fromHandle,
fromPosition: fromHandle.position,
fromNode: fromNodeInternal.internals.userNode,
fromNode: fromNodeInternal,
to: position,
toHandle: null,
@@ -163,7 +163,7 @@ function onPointerDown(
: position,
toHandle: result.toHandle,
toPosition: isValid && result.toHandle ? result.toHandle.position : oppositePosition[fromHandle.position],
toNode: result.toHandle ? nodeLookup.get(result.toHandle.nodeId)!.internals.userNode : null,
toNode: result.toHandle ? nodeLookup.get(result.toHandle.nodeId)! : null,
};
// we don't want to trigger an update when the connection