update(types): remove promise from addelements
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com> update(store): remove promise from setElements Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import microDiff from 'microdiff'
|
||||
import { setActivePinia, createPinia, defineStore, StoreDefinition, acceptHMRUpdate } from 'pinia'
|
||||
import { FlowState, FlowActions, Elements, FlowGetters, GraphNode, GraphEdge, Edge, NextElements } from '~/types'
|
||||
import { FlowState, FlowActions, Elements, FlowGetters, GraphNode, GraphEdge, Edge } from '~/types'
|
||||
import {
|
||||
getConnectedEdges,
|
||||
getNodesInside,
|
||||
@@ -10,8 +10,6 @@ import {
|
||||
isGraphNode,
|
||||
getSourceTargetNodes,
|
||||
isEdge,
|
||||
processElements,
|
||||
parseElement,
|
||||
parseElements,
|
||||
} from '~/utils'
|
||||
|
||||
@@ -86,7 +84,7 @@ export default (id: string, preloadedState: FlowState) => {
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
async setElements(elements) {
|
||||
setElements(elements) {
|
||||
const { nodes, edges } = parseElements(elements, this.elements, this.nodeExtent)
|
||||
edges.forEach((edge: Edge, i, arr) => {
|
||||
const { sourceNode, targetNode } = getSourceTargetNodes(edge, nodes)
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ export interface FlowState extends Omit<FlowOptions, 'elements'> {
|
||||
}
|
||||
|
||||
export interface FlowActions {
|
||||
setElements: (elements: Elements) => Promise<void>
|
||||
setElements: (elements: Elements) => void
|
||||
setUserSelection: (mousePos: XYPosition) => void
|
||||
updateUserSelection: (mousePos: XYPosition) => void
|
||||
unsetUserSelection: () => void
|
||||
|
||||
Reference in New Issue
Block a user