Change boolean 'isSourceHandle' parameter to handleType: HandleType in 'onEdgeUpdateStart' function
- In order to make the function better extendable in the future.
This commit is contained in:
@@ -137,10 +137,11 @@ export default (EdgeComponent: ComponentType<EdgeProps>) => {
|
||||
(event: React.MouseEvent<SVGGElement, MouseEvent>, isSourceHandle: boolean) => {
|
||||
const nodeId = isSourceHandle ? target : source;
|
||||
const handleId = isSourceHandle ? targetHandleId : sourceHandleId;
|
||||
const handleType = isSourceHandle ? 'target' : 'source'
|
||||
const isValidConnection = () => true;
|
||||
const isTarget = isSourceHandle;
|
||||
|
||||
onEdgeUpdateStart?.(event, edgeElement, isSourceHandle);
|
||||
onEdgeUpdateStart?.(event, edgeElement, handleType);
|
||||
|
||||
const _onEdgeUpdate = onEdgeUpdateEnd
|
||||
? (evt: MouseEvent): void => onEdgeUpdateEnd(evt, edgeElement)
|
||||
@@ -156,7 +157,7 @@ export default (EdgeComponent: ComponentType<EdgeProps>) => {
|
||||
isTarget,
|
||||
isValidConnection,
|
||||
connectionMode,
|
||||
isSourceHandle ? 'target' : 'source',
|
||||
handleType,
|
||||
_onEdgeUpdate
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user