refactor(react/handle-connection-state): cleanup

This commit is contained in:
moklick
2023-12-04 14:23:42 +01:00
parent 124df00f60
commit b6743a3cf3
5 changed files with 50 additions and 40 deletions
+1
View File
@@ -330,6 +330,7 @@ const createRFStore = ({
set(currentConnection);
},
reset: () => {
// @todo: what should we do about this? Do we still need it?
// if you are on a SPA with multiple flows, we want to make sure that the store gets resetted
+1 -3
View File
@@ -47,9 +47,7 @@ export function updateNodesAndEdgesSelections({ changedNodes, changedEdges, get,
export function updateConnectionLookup(lookup: Map<string, Connection[]>, edges: Edge[]) {
lookup.clear();
edges.forEach((edge) => {
const { source, target, sourceHandle = null, targetHandle = null } = edge;
edges.forEach(({ source, target, sourceHandle = null, targetHandle = null }) => {
if (source && target) {
const sourceKey = `${source}-source-${sourceHandle}`;
const targetKey = `${target}-target-${targetHandle}`;