chore(svelte/onConnect): cleanup
This commit is contained in:
@@ -80,20 +80,17 @@
|
|||||||
updateConnection,
|
updateConnection,
|
||||||
cancelConnection,
|
cancelConnection,
|
||||||
panBy,
|
panBy,
|
||||||
onConnect: (connection) => {
|
onConnect: (_connection) => {
|
||||||
if ($onedgecreate) {
|
let connection = $onedgecreate ? $onedgecreate(_connection) : _connection;
|
||||||
const modifiedConnection = $onedgecreate(connection);
|
|
||||||
if (modifiedConnection) {
|
if (!connection) {
|
||||||
addEdge(modifiedConnection);
|
|
||||||
dispatch('connect', { connection });
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
addEdge(connection);
|
addEdge(connection);
|
||||||
// @todo: should we change/ improve the stuff we are passing here?
|
// @todo: should we change/ improve the stuff we are passing here?
|
||||||
// instead of source/target we could pass fromNodeId, fromHandleId, etc
|
// instead of source/target we could pass fromNodeId, fromHandleId, etc
|
||||||
dispatch('connect', { connection });
|
dispatch('connect', { connection: _connection });
|
||||||
},
|
},
|
||||||
onConnectStart: (event, startParams) => {
|
onConnectStart: (event, startParams) => {
|
||||||
dispatch('connectstart', {
|
dispatch('connectstart', {
|
||||||
|
|||||||
Reference in New Issue
Block a user