### What problem does this PR solve? feat: build categorize list from object #918 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@@ -39,6 +39,7 @@ export type RFState = {
|
||||
deleteEdgeById: (id: string) => void;
|
||||
deleteNodeById: (id: string) => void;
|
||||
findNodeByName: (operatorName: Operator) => Node | undefined;
|
||||
findNodeById: (id: string) => Node | undefined;
|
||||
};
|
||||
|
||||
// this is our useStore hook that we can use in our components to get parts of the store and call actions
|
||||
@@ -125,6 +126,9 @@ const useGraphStore = create<RFState>()(
|
||||
findNodeByName: (name: Operator) => {
|
||||
return get().nodes.find((x) => x.data.label === name);
|
||||
},
|
||||
findNodeById: (id: string) => {
|
||||
return get().nodes.find((x) => x.id === id);
|
||||
},
|
||||
updateNodeForm: (nodeId: string, values: any) => {
|
||||
set({
|
||||
nodes: get().nodes.map((node) => {
|
||||
|
||||
Reference in New Issue
Block a user