refactor(connectionlookup): use maps instead of arrays

This commit is contained in:
moklick
2023-12-06 17:49:34 +01:00
parent b6743a3cf3
commit a58f915697
6 changed files with 76 additions and 61 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ const getInitialState = ({
fitView?: boolean;
} = {}): ReactFlowStore => {
const nodeLookup = new Map<string, Node>();
const connectionLookup = updateConnectionLookup(new Map<string, Connection[]>(), edges);
const connectionLookup = updateConnectionLookup(new Map<string, Map<string, Connection>>(), edges);
const nextNodes = updateNodes(nodes, nodeLookup, { nodeOrigin: [0, 0], elevateNodesOnSelect: false });
let transform: Transform = [0, 0, 1];