refactor(utils): remove react dependencies

This commit is contained in:
moklick
2023-03-02 14:32:39 +01:00
parent 3b83e029e6
commit df6c3381b1
7 changed files with 19 additions and 49 deletions
@@ -21,7 +21,6 @@
const handleId = id || null;
const dispatch = createEventDispatcher();
const {
connectionMode,
domNode,
@@ -34,13 +33,13 @@
updateConnection
} = useStore();
function dispatchEvent(eventName: string) {
dispatch(eventName, { nodeId, handleId, type });
function dispatchEvent(eventName: string, params?: Connection) {
dispatch(eventName, params || { nodeId, handleId, type });
}
function onConnectExtended(params: Connection) {
addEdge(params);
dispatchEvent('connect')
dispatchEvent('connect', params)
}
function onPointerDown(event: MouseEvent | TouchEvent) {
@@ -66,12 +65,6 @@
onConnectEnd: () => dispatchEvent('connect:end')
});
}
// if (isMouseTriggered) {
// onMouseDown?.(event);
// } else {
// onTouchStart?.(event);
// }
}
</script>