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:
Braks
2021-11-25 15:21:36 +01:00
parent 929a6e637b
commit 9c7c2368a0
2 changed files with 3 additions and 5 deletions
+2 -4
View File
@@ -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
View File
@@ -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