refactor(store): rename nodeLookup to nodeInternals

This commit is contained in:
moklick
2021-11-04 18:13:21 +01:00
parent cc7debf8de
commit 996b1b51f5
13 changed files with 142 additions and 128 deletions
+4 -4
View File
@@ -6,7 +6,7 @@ import { getBezierPath } from '../Edges/BezierEdge';
import { getSmoothStepPath } from '../Edges/SmoothStepEdge';
import {
ElementId,
NodeLookupItem,
NodeInternalsItem,
HandleElement,
Position,
ConnectionLineType,
@@ -28,7 +28,7 @@ interface ConnectionLineProps {
CustomConnectionLineComponent?: ConnectionLineComponent;
}
const selector = (s: ReactFlowState) => ({ nodeLookup: s.nodeLookup, nodes: s.nodes, transform: s.transform });
const selector = (s: ReactFlowState) => ({ nodeInternals: s.nodeInternals, nodes: s.nodes, transform: s.transform });
export default ({
connectionNodeId,
@@ -44,8 +44,8 @@ export default ({
const nodeId = connectionNodeId;
const handleId = connectionHandleId;
const { nodeLookup, nodes, transform } = useStore(selector, shallow);
const sourceNodeInternals = useRef<NodeLookupItem | undefined>(nodeLookup.get(nodeId));
const { nodeInternals, nodes, transform } = useStore(selector, shallow);
const sourceNodeInternals = useRef<NodeInternalsItem | undefined>(nodeInternals.get(nodeId));
const sourceNode = useRef<Node | undefined>(nodes.find((n) => n.id === nodeId));
if (