chore(react): cleanup

This commit is contained in:
moklick
2023-06-12 17:21:02 +02:00
parent c6501aff62
commit a41ec8f1bc
3 changed files with 8 additions and 19 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ import UserSelection from '../../components/UserSelection';
import { containerStyle } from '../../styles';
import { useStore, useStoreApi } from '../../hooks/useStore';
import { getSelectionChanges, getConnectedEdges } from '../../utils';
import type { ReactFlowProps, ReactFlowState, NodeChange, EdgeChange, Node } from '../../types';
import type { ReactFlowProps, ReactFlowState, NodeChange, EdgeChange } from '../../types';
type PaneProps = {
isSelecting: boolean;
@@ -148,7 +148,7 @@ const Pane = memo(
height: Math.abs(mousePos.y - startY),
};
const selectedNodes = getNodesInside<Node>(
const selectedNodes = getNodesInside(
nodes,
nextUserSelectRect,
transform,
+1 -4
View File
@@ -112,7 +112,6 @@ const createRFStore = () =>
const nextFitViewOnInitDone =
fitViewOnInitDone ||
(fitViewOnInit &&
!fitViewOnInitDone &&
!!panZoom &&
fitView(
{
@@ -133,8 +132,6 @@ const createRFStore = () =>
}
},
updateNodePositions: (nodeDragItems, positionChanged = true, dragging = false) => {
const { triggerNodeChanges } = get();
const changes = nodeDragItems.map((node) => {
const change: NodePositionChange = {
id: node.id,
@@ -150,7 +147,7 @@ const createRFStore = () =>
return change;
});
triggerNodeChanges(changes);
get().triggerNodeChanges(changes);
},
triggerNodeChanges: (changes) => {