refactor(deps): remove easy-peasy and redux-thunk
This commit is contained in:
Generated
+5
-111
@@ -13,12 +13,10 @@
|
||||
"classcat": "^4.1.0",
|
||||
"d3-selection": "^2.0.0",
|
||||
"d3-zoom": "^2.0.0",
|
||||
"easy-peasy": "^4.0.1",
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"react-draggable": "^4.4.3",
|
||||
"react-redux": "^7.2.2",
|
||||
"redux": "^4.0.5",
|
||||
"redux-thunk": "^2.3.0"
|
||||
"redux": "^4.0.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.12.13",
|
||||
@@ -4298,21 +4296,6 @@
|
||||
"integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/easy-peasy": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/easy-peasy/-/easy-peasy-4.0.1.tgz",
|
||||
"integrity": "sha512-aTvB48M2ej6dM/wllUm1F7CTWGnYOYh82SHBkvJtOZhJ/9L8Gmg/nIVqDPwJeojOWZe+gbLtpyi8DhN6fPNBYg==",
|
||||
"dependencies": {
|
||||
"immer": "7.0.9",
|
||||
"is-plain-object": "^5.0.0",
|
||||
"memoizerific": "^1.11.3",
|
||||
"redux": "^4.0.5",
|
||||
"redux-thunk": "^2.3.0",
|
||||
"symbol-observable": "^2.0.3",
|
||||
"ts-toolbelt": "^8.0.7",
|
||||
"use-memo-one": "^1.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/ecc-jsbn": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",
|
||||
@@ -5114,11 +5097,6 @@
|
||||
"integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/immer": {
|
||||
"version": "7.0.9",
|
||||
"resolved": "https://registry.npmjs.org/immer/-/immer-7.0.9.tgz",
|
||||
"integrity": "sha512-Vs/gxoM4DqNAYR7pugIxi0Xc8XAun/uy7AQu4fLLqaTBHxjOP9pJ266Q9MWA/ly4z6rAFZbvViOtihxUZ7O28A=="
|
||||
},
|
||||
"node_modules/import-cwd": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/import-cwd/-/import-cwd-3.0.0.tgz",
|
||||
@@ -5498,7 +5476,8 @@
|
||||
"node_modules/is-plain-object": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
|
||||
"integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q=="
|
||||
"integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/is-promise": {
|
||||
"version": "2.2.2",
|
||||
@@ -6151,11 +6130,6 @@
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/map-or-similar": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/map-or-similar/-/map-or-similar-1.5.0.tgz",
|
||||
"integrity": "sha1-beJlMXSt+12e3DPGnT6Sobdvrwg="
|
||||
},
|
||||
"node_modules/map-stream": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz",
|
||||
@@ -6214,14 +6188,6 @@
|
||||
"integrity": "sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/memoizerific": {
|
||||
"version": "1.11.3",
|
||||
"resolved": "https://registry.npmjs.org/memoizerific/-/memoizerific-1.11.3.tgz",
|
||||
"integrity": "sha1-fIekZGREwy11Q4VwkF8tvRsagFo=",
|
||||
"dependencies": {
|
||||
"map-or-similar": "^1.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/merge-stream": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
|
||||
@@ -8705,11 +8671,6 @@
|
||||
"symbol-observable": "^1.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/redux-thunk": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-2.3.0.tgz",
|
||||
"integrity": "sha512-km6dclyFnmcvxhAcrQV2AkZmPQjzPDjgVlQtR0EQjxZPyJ0BnMf3in1ryuR8A2qU0HldVRfxYXbFSKlI3N7Slw=="
|
||||
},
|
||||
"node_modules/redux/node_modules/symbol-observable": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz",
|
||||
@@ -9746,11 +9707,6 @@
|
||||
"util.promisify": "~1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/symbol-observable": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-2.0.3.tgz",
|
||||
"integrity": "sha512-sQV7phh2WCYAn81oAkakC5qjq2Ml0g8ozqz03wOGnx9dDlG1de6yrF+0RAzSJD8fPUow3PTSMf2SAbOGxb93BA=="
|
||||
},
|
||||
"node_modules/term-size": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.1.tgz",
|
||||
@@ -9827,11 +9783,6 @@
|
||||
"punycode": "^2.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/ts-toolbelt": {
|
||||
"version": "8.0.7",
|
||||
"resolved": "https://registry.npmjs.org/ts-toolbelt/-/ts-toolbelt-8.0.7.tgz",
|
||||
"integrity": "sha512-KICHyKxc5Nu34kyoODrEe2+zvuQQaubTJz7pnC5RQ19TH/Jged1xv+h8LBrouaSD310m75oAljYs59LNHkLDkQ=="
|
||||
},
|
||||
"node_modules/tslib": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz",
|
||||
@@ -10085,11 +10036,6 @@
|
||||
"integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/use-memo-one": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/use-memo-one/-/use-memo-one-1.1.1.tgz",
|
||||
"integrity": "sha512-oFfsyun+bP7RX8X2AskHNTxu+R3QdE/RC5IefMbqptmACAA/gfol1KDD5KRzPsGMa62sWxGZw+Ui43u6x4ddoQ=="
|
||||
},
|
||||
"node_modules/util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
@@ -14280,21 +14226,6 @@
|
||||
"integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=",
|
||||
"dev": true
|
||||
},
|
||||
"easy-peasy": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/easy-peasy/-/easy-peasy-4.0.1.tgz",
|
||||
"integrity": "sha512-aTvB48M2ej6dM/wllUm1F7CTWGnYOYh82SHBkvJtOZhJ/9L8Gmg/nIVqDPwJeojOWZe+gbLtpyi8DhN6fPNBYg==",
|
||||
"requires": {
|
||||
"immer": "7.0.9",
|
||||
"is-plain-object": "^5.0.0",
|
||||
"memoizerific": "^1.11.3",
|
||||
"redux": "^4.0.5",
|
||||
"redux-thunk": "^2.3.0",
|
||||
"symbol-observable": "^2.0.3",
|
||||
"ts-toolbelt": "^8.0.7",
|
||||
"use-memo-one": "^1.1.1"
|
||||
}
|
||||
},
|
||||
"ecc-jsbn": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",
|
||||
@@ -15052,11 +14983,6 @@
|
||||
"integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=",
|
||||
"dev": true
|
||||
},
|
||||
"immer": {
|
||||
"version": "7.0.9",
|
||||
"resolved": "https://registry.npmjs.org/immer/-/immer-7.0.9.tgz",
|
||||
"integrity": "sha512-Vs/gxoM4DqNAYR7pugIxi0Xc8XAun/uy7AQu4fLLqaTBHxjOP9pJ266Q9MWA/ly4z6rAFZbvViOtihxUZ7O28A=="
|
||||
},
|
||||
"import-cwd": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/import-cwd/-/import-cwd-3.0.0.tgz",
|
||||
@@ -15439,7 +15365,8 @@
|
||||
"is-plain-object": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
|
||||
"integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q=="
|
||||
"integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==",
|
||||
"dev": true
|
||||
},
|
||||
"is-promise": {
|
||||
"version": "2.2.2",
|
||||
@@ -16108,11 +16035,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"map-or-similar": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/map-or-similar/-/map-or-similar-1.5.0.tgz",
|
||||
"integrity": "sha1-beJlMXSt+12e3DPGnT6Sobdvrwg="
|
||||
},
|
||||
"map-stream": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz",
|
||||
@@ -16173,14 +16095,6 @@
|
||||
"integrity": "sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA==",
|
||||
"dev": true
|
||||
},
|
||||
"memoizerific": {
|
||||
"version": "1.11.3",
|
||||
"resolved": "https://registry.npmjs.org/memoizerific/-/memoizerific-1.11.3.tgz",
|
||||
"integrity": "sha1-fIekZGREwy11Q4VwkF8tvRsagFo=",
|
||||
"requires": {
|
||||
"map-or-similar": "^1.5.0"
|
||||
}
|
||||
},
|
||||
"merge-stream": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
|
||||
@@ -18611,11 +18525,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"redux-thunk": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-2.3.0.tgz",
|
||||
"integrity": "sha512-km6dclyFnmcvxhAcrQV2AkZmPQjzPDjgVlQtR0EQjxZPyJ0BnMf3in1ryuR8A2qU0HldVRfxYXbFSKlI3N7Slw=="
|
||||
},
|
||||
"regenerate": {
|
||||
"version": "1.4.2",
|
||||
"resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz",
|
||||
@@ -19605,11 +19514,6 @@
|
||||
"util.promisify": "~1.0.0"
|
||||
}
|
||||
},
|
||||
"symbol-observable": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-2.0.3.tgz",
|
||||
"integrity": "sha512-sQV7phh2WCYAn81oAkakC5qjq2Ml0g8ozqz03wOGnx9dDlG1de6yrF+0RAzSJD8fPUow3PTSMf2SAbOGxb93BA=="
|
||||
},
|
||||
"term-size": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.1.tgz",
|
||||
@@ -19686,11 +19590,6 @@
|
||||
"punycode": "^2.1.1"
|
||||
}
|
||||
},
|
||||
"ts-toolbelt": {
|
||||
"version": "8.0.7",
|
||||
"resolved": "https://registry.npmjs.org/ts-toolbelt/-/ts-toolbelt-8.0.7.tgz",
|
||||
"integrity": "sha512-KICHyKxc5Nu34kyoODrEe2+zvuQQaubTJz7pnC5RQ19TH/Jged1xv+h8LBrouaSD310m75oAljYs59LNHkLDkQ=="
|
||||
},
|
||||
"tslib": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz",
|
||||
@@ -19936,11 +19835,6 @@
|
||||
"prepend-http": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"use-memo-one": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/use-memo-one/-/use-memo-one-1.1.1.tgz",
|
||||
"integrity": "sha512-oFfsyun+bP7RX8X2AskHNTxu+R3QdE/RC5IefMbqptmACAA/gfol1KDD5KRzPsGMa62sWxGZw+Ui43u6x4ddoQ=="
|
||||
},
|
||||
"util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
|
||||
+1
-3
@@ -33,12 +33,10 @@
|
||||
"classcat": "^4.1.0",
|
||||
"d3-selection": "^2.0.0",
|
||||
"d3-zoom": "^2.0.0",
|
||||
"easy-peasy": "^4.0.1",
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"react-draggable": "^4.4.3",
|
||||
"react-redux": "^7.2.2",
|
||||
"redux": "^4.0.5",
|
||||
"redux-thunk": "^2.3.0"
|
||||
"redux": "^4.0.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.12.13",
|
||||
|
||||
+37
-70
@@ -20,147 +20,114 @@ import {
|
||||
NodeExtent,
|
||||
} from '../types';
|
||||
|
||||
import {
|
||||
SET_ON_CONNECT,
|
||||
SET_ON_CONNECT_START,
|
||||
SET_ON_CONNECT_STOP,
|
||||
SET_ON_CONNECT_END,
|
||||
SET_ELEMENTS,
|
||||
BATCH_UPDATE_NODE_DIMENSIONS,
|
||||
UPDATE_NODE_DIMENSIONS,
|
||||
UPDATE_NODE_POS,
|
||||
UPDATE_NODE_POS_DIFF,
|
||||
SET_USER_SELECTION,
|
||||
UNSET_USER_SELECTION,
|
||||
UPDATE_USER_SELECTION,
|
||||
SET_SELECTION,
|
||||
UNSET_NODES_SELECTION,
|
||||
RESET_SELECTED_ELEMENTS,
|
||||
SET_SELECTED_ELEMENTS,
|
||||
ADD_SELECTED_ELEMENTS,
|
||||
UPDATE_TRANSFORM,
|
||||
UPDATE_SIZE,
|
||||
INIT_D3ZOOM,
|
||||
SET_MINZOOM,
|
||||
SET_MAXZOOM,
|
||||
SET_TRANSLATEEXTENT,
|
||||
SET_CONNECTION_POSITION,
|
||||
SET_CONNECTION_NODEID,
|
||||
SET_SNAPTOGRID,
|
||||
SET_SNAPGRID,
|
||||
SET_INTERACTIVE,
|
||||
SET_NODES_DRAGGABLE,
|
||||
SET_NODES_CONNECTABLE,
|
||||
SET_ELEMENTS_SELECTABLE,
|
||||
SET_MULTI_SELECTION_ACTIVE,
|
||||
SET_CONNECTION_MODE,
|
||||
SET_NODE_EXTENT,
|
||||
} from './contants';
|
||||
import * as constants from './contants';
|
||||
|
||||
export const setOnConnect = (onConnect: OnConnectFunc) =>
|
||||
createAction(SET_ON_CONNECT, {
|
||||
createAction(constants.SET_ON_CONNECT, {
|
||||
onConnect,
|
||||
});
|
||||
|
||||
export const setOnConnectStart = (onConnectStart: OnConnectStartFunc) =>
|
||||
createAction(SET_ON_CONNECT_START, {
|
||||
createAction(constants.SET_ON_CONNECT_START, {
|
||||
onConnectStart,
|
||||
});
|
||||
|
||||
export const setOnConnectStop = (onConnectStop: OnConnectStopFunc) =>
|
||||
createAction(SET_ON_CONNECT_STOP, {
|
||||
createAction(constants.SET_ON_CONNECT_STOP, {
|
||||
onConnectStop,
|
||||
});
|
||||
|
||||
export const setOnConnectEnd = (onConnectEnd: OnConnectEndFunc) =>
|
||||
createAction(SET_ON_CONNECT_END, {
|
||||
createAction(constants.SET_ON_CONNECT_END, {
|
||||
onConnectEnd,
|
||||
});
|
||||
|
||||
export const setElements = (elements: Elements) => createAction(SET_ELEMENTS, elements);
|
||||
export const setElements = (elements: Elements) => createAction(constants.SET_ELEMENTS, elements);
|
||||
|
||||
export const batchUpdateNodeDimensions = (updates: NodeDimensionUpdate[]) =>
|
||||
createAction(BATCH_UPDATE_NODE_DIMENSIONS, updates);
|
||||
createAction(constants.BATCH_UPDATE_NODE_DIMENSIONS, updates);
|
||||
|
||||
export const updateNodeDimensions = (payload: NodeDimensionUpdate) => createAction(UPDATE_NODE_DIMENSIONS, payload);
|
||||
export const updateNodeDimensions = (payload: NodeDimensionUpdate) =>
|
||||
createAction(constants.UPDATE_NODE_DIMENSIONS, payload);
|
||||
|
||||
export const updateNodePos = (payload: NodePosUpdate) => createAction(UPDATE_NODE_POS, payload);
|
||||
export const updateNodePos = (payload: NodePosUpdate) => createAction(constants.UPDATE_NODE_POS, payload);
|
||||
|
||||
export const updateNodePosDiff = (payload: NodeDiffUpdate) => createAction(UPDATE_NODE_POS_DIFF, payload);
|
||||
export const updateNodePosDiff = (payload: NodeDiffUpdate) => createAction(constants.UPDATE_NODE_POS_DIFF, payload);
|
||||
|
||||
export const setUserSelection = (mousePos: XYPosition) => createAction(SET_USER_SELECTION, mousePos);
|
||||
export const setUserSelection = (mousePos: XYPosition) => createAction(constants.SET_USER_SELECTION, mousePos);
|
||||
|
||||
export const updateUserSelection = (mousePos: XYPosition) => createAction(UPDATE_USER_SELECTION, mousePos);
|
||||
export const updateUserSelection = (mousePos: XYPosition) => createAction(constants.UPDATE_USER_SELECTION, mousePos);
|
||||
|
||||
export const unsetUserSelection = () => createAction(UNSET_USER_SELECTION);
|
||||
export const unsetUserSelection = () => createAction(constants.UNSET_USER_SELECTION);
|
||||
|
||||
export const setSelection = (selectionActive: boolean) =>
|
||||
createAction(SET_SELECTION, {
|
||||
createAction(constants.SET_SELECTION, {
|
||||
selectionActive,
|
||||
});
|
||||
|
||||
export const unsetNodesSelection = () =>
|
||||
createAction(UNSET_NODES_SELECTION, {
|
||||
createAction(constants.UNSET_NODES_SELECTION, {
|
||||
nodesSelectionActive: false,
|
||||
});
|
||||
|
||||
export const resetSelectedElements = () =>
|
||||
createAction(RESET_SELECTED_ELEMENTS, {
|
||||
createAction(constants.RESET_SELECTED_ELEMENTS, {
|
||||
selectedElements: null,
|
||||
});
|
||||
|
||||
export const setSelectedElements = (elements: Elements) => createAction(SET_SELECTED_ELEMENTS, elements);
|
||||
export const setSelectedElements = (elements: Elements) => createAction(constants.SET_SELECTED_ELEMENTS, elements);
|
||||
|
||||
export const addSelectedElements = (elements: Elements) => createAction(ADD_SELECTED_ELEMENTS, elements);
|
||||
export const addSelectedElements = (elements: Elements) => createAction(constants.ADD_SELECTED_ELEMENTS, elements);
|
||||
|
||||
export const updateTransform = (transform: Transform) => createAction(UPDATE_TRANSFORM, { transform });
|
||||
export const updateTransform = (transform: Transform) => createAction(constants.UPDATE_TRANSFORM, { transform });
|
||||
|
||||
export const updateSize = (size: Dimensions) =>
|
||||
createAction(UPDATE_SIZE, {
|
||||
createAction(constants.UPDATE_SIZE, {
|
||||
width: size.width || 500,
|
||||
height: size.height || 500,
|
||||
});
|
||||
|
||||
export const initD3Zoom = (payload: InitD3ZoomPayload) => createAction(INIT_D3ZOOM, payload);
|
||||
export const initD3Zoom = (payload: InitD3ZoomPayload) => createAction(constants.INIT_D3ZOOM, payload);
|
||||
|
||||
export const setMinZoom = (minZoom: number) => createAction(SET_MINZOOM, minZoom);
|
||||
export const setMinZoom = (minZoom: number) => createAction(constants.SET_MINZOOM, minZoom);
|
||||
|
||||
export const setMaxZoom = (maxZoom: number) => createAction(SET_MAXZOOM, maxZoom);
|
||||
export const setMaxZoom = (maxZoom: number) => createAction(constants.SET_MAXZOOM, maxZoom);
|
||||
|
||||
export const setTranslateExtent = (translateExtent: TranslateExtent) =>
|
||||
createAction(SET_TRANSLATEEXTENT, translateExtent);
|
||||
createAction(constants.SET_TRANSLATEEXTENT, translateExtent);
|
||||
|
||||
export const setConnectionPosition = (connectionPosition: XYPosition) =>
|
||||
createAction(SET_CONNECTION_POSITION, { connectionPosition });
|
||||
createAction(constants.SET_CONNECTION_POSITION, { connectionPosition });
|
||||
|
||||
export const setConnectionNodeId = (payload: SetConnectionId) => createAction(SET_CONNECTION_NODEID, payload);
|
||||
export const setConnectionNodeId = (payload: SetConnectionId) => createAction(constants.SET_CONNECTION_NODEID, payload);
|
||||
|
||||
export const setSnapToGrid = (snapToGrid: boolean) => createAction(SET_SNAPTOGRID, { snapToGrid });
|
||||
export const setSnapToGrid = (snapToGrid: boolean) => createAction(constants.SET_SNAPTOGRID, { snapToGrid });
|
||||
|
||||
export const setSnapGrid = (snapGrid: SnapGrid) => createAction(SET_SNAPGRID, { snapGrid });
|
||||
export const setSnapGrid = (snapGrid: SnapGrid) => createAction(constants.SET_SNAPGRID, { snapGrid });
|
||||
|
||||
export const setInteractive = (isInteractive: boolean) =>
|
||||
createAction(SET_INTERACTIVE, {
|
||||
createAction(constants.SET_INTERACTIVE, {
|
||||
nodesDraggable: isInteractive,
|
||||
nodesConnectable: isInteractive,
|
||||
elementsSelectable: isInteractive,
|
||||
});
|
||||
|
||||
export const setNodesDraggable = (nodesDraggable: boolean) => createAction(SET_NODES_DRAGGABLE, { nodesDraggable });
|
||||
export const setNodesDraggable = (nodesDraggable: boolean) =>
|
||||
createAction(constants.SET_NODES_DRAGGABLE, { nodesDraggable });
|
||||
|
||||
export const setNodesConnectable = (nodesConnectable: boolean) =>
|
||||
createAction(SET_NODES_CONNECTABLE, { nodesConnectable });
|
||||
createAction(constants.SET_NODES_CONNECTABLE, { nodesConnectable });
|
||||
|
||||
export const setElementsSelectable = (elementsSelectable: boolean) =>
|
||||
createAction(SET_ELEMENTS_SELECTABLE, { elementsSelectable });
|
||||
createAction(constants.SET_ELEMENTS_SELECTABLE, { elementsSelectable });
|
||||
|
||||
export const setMultiSelectionActive = (multiSelectionActive: boolean) =>
|
||||
createAction(SET_MULTI_SELECTION_ACTIVE, { multiSelectionActive });
|
||||
createAction(constants.SET_MULTI_SELECTION_ACTIVE, { multiSelectionActive });
|
||||
|
||||
export const setConnectionMode = (connectionMode: ConnectionMode) =>
|
||||
createAction(SET_CONNECTION_MODE, { connectionMode });
|
||||
createAction(constants.SET_CONNECTION_MODE, { connectionMode });
|
||||
|
||||
export const setNodeExtent = (nodeExtent: NodeExtent) => createAction(SET_NODE_EXTENT, { nodeExtent });
|
||||
export const setNodeExtent = (nodeExtent: NodeExtent) => createAction(constants.SET_NODE_EXTENT, { nodeExtent });
|
||||
|
||||
export type ReactFlowAction = ReturnType<
|
||||
| typeof setOnConnect
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
import { applyMiddleware, compose, createStore, Store } from 'redux';
|
||||
import thunkMiddleware from 'redux-thunk';
|
||||
import { createStore, Store } from 'redux';
|
||||
|
||||
import { ReactFlowState } from '../types';
|
||||
import { ReactFlowAction } from './actions';
|
||||
import reactFlowReducer from './reducer';
|
||||
|
||||
export default function configureStore(preloadedState: ReactFlowState): Store<ReactFlowState, ReactFlowAction> {
|
||||
const composedEnhancers = compose(applyMiddleware(thunkMiddleware));
|
||||
const store = createStore(reactFlowReducer, preloadedState, composedEnhancers);
|
||||
|
||||
const store = createStore(reactFlowReducer, preloadedState);
|
||||
return store;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user