refactor(controls): dont import store but use actions

This commit is contained in:
moklick
2020-06-04 23:46:37 +02:00
parent a73c448edc
commit 407e34b1cb
7 changed files with 73 additions and 21 deletions
+1 -1
View File
@@ -182,7 +182,7 @@ export const getConnectedEdges = (nodes: Node[], edges: Edge[]): Edge[] => {
});
};
export const fitView = ({ padding }: FitViewParams = { padding: 0.1 }): void => {
export const fitView = ({ padding = 0.1 }: FitViewParams = { padding: 0.1 }): void => {
const { nodes, width, height, d3Selection, d3Zoom } = store.getState();
if (!d3Selection || !d3Zoom || !nodes.length) {