feat: fetch flow (#1068)

### What problem does this PR solve?
feat: fetch flow #918 
feat: save graph

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-06-06 11:01:14 +08:00
committed by GitHub
parent b6980d8a16
commit 72c6784ff8
22 changed files with 241 additions and 90 deletions

View File

@ -17,9 +17,6 @@ import {
import { create } from 'zustand';
import { devtools } from 'zustand/middleware';
import { NodeData } from './interface';
import { dsl } from './mock';
const { nodes: initialNodes, edges: initialEdges } = dsl.graph;
export type RFState = {
nodes: Node<NodeData>[];
@ -41,8 +38,8 @@ export type RFState = {
// this is our useStore hook that we can use in our components to get parts of the store and call actions
const useStore = create<RFState>()(
devtools((set, get) => ({
nodes: initialNodes as Node[],
edges: initialEdges as Edge[],
nodes: [] as Node[],
edges: [] as Edge[],
selectedNodeIds: [],
selectedEdgeIds: [],
onNodesChange: (changes: NodeChange[]) => {