refactor(store): check if state variables have to be re-set
* instead of just pasting over the state constantly check what needs to be re-set Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -9,6 +9,11 @@ export type FlowElement<T = any> = GraphNode<T> | GraphEdge<T>
|
||||
export type FlowElements<T = any> = FlowElement<T>[]
|
||||
export type Elements<T = any> = (Node<T> | Edge<T>)[]
|
||||
|
||||
export type NextElements = {
|
||||
nodes: GraphNode[]
|
||||
edges: GraphEdge[]
|
||||
}
|
||||
|
||||
export type Transform = [number, number, number]
|
||||
|
||||
export enum Position {
|
||||
|
||||
+2
-1
@@ -73,7 +73,7 @@ export interface FlowState extends Omit<FlowOptions, 'elements'> {
|
||||
}
|
||||
|
||||
export interface FlowActions {
|
||||
setElements: (elements: Elements) => void
|
||||
setElements: (elements: Elements) => Promise<void>
|
||||
setUserSelection: (mousePos: XYPosition) => void
|
||||
updateUserSelection: (mousePos: XYPosition) => void
|
||||
unsetUserSelection: () => void
|
||||
@@ -89,6 +89,7 @@ export interface FlowActions {
|
||||
setConnectionNodeId: (payload: SetConnectionId) => void
|
||||
setInteractive: (isInteractive: boolean) => void
|
||||
addElements: (elements: Elements) => void
|
||||
setState: (state: FlowOptions) => Promise<void>
|
||||
}
|
||||
|
||||
export interface FlowGetters {
|
||||
|
||||
Reference in New Issue
Block a user