Skip to Content
🚨 New Example: Handling Node Collisions!
ReferenceTypesOnBeforeReconnect

OnBeforeReconnect

Source on GitHub 

The OnBeforeReconnect type is a callback function that is called before an edge is reconnected.

The callback receives the new edge (with the updated connection) and the original edge being reconnected. You can return the new edge or a modified version of it. Returning false, null, or undefined aborts the reconnection.

Aborting the reconnection restores the edge to its original state. To delete the edge instead, call deleteElements to remove it, then return null.

See the Reconnect Edge example for more information on how to implement edge reconnection.

type OnBeforeReconnect<EdgeType extends Edge = Edge> = ( newEdge: EdgeType, oldEdge: EdgeType, ) => EdgeType | void | false | null;
Parameters:
NameTypeDefault
newEdgeEdgeType
oldEdgeEdgeType
Returns:
false | void | EdgeType | null
Last updated on