chore(flowManagerStore.ts): add isPending property to RFState to track pending state

chore(tabs/index.ts): keep existing properties and functions in FlowsContextType for future use
This commit is contained in:
anovazzi1 2024-01-04 18:51:32 -03:00
commit ca7193476d
2 changed files with 9 additions and 0 deletions

View file

@ -31,6 +31,7 @@ type RFState = {
lastCopiedSelection: { nodes: any; edges: any };
nodeId: string;
incrementNodeId: () => void;
isPending: boolean;
};
// this is our useStore hook that we can use in our components to get parts of the store and call actions
@ -71,6 +72,7 @@ const useStore = create<RFState>((set, get) => ({
incrementNodeId: () => {
set((state) => ({ nodeId: uid() }));
},
isPending: false,
}));
export default useStore;

View file

@ -5,14 +5,19 @@ import { FlowType, NodeDataType } from "../flow";
type OnChange<ChangesType> = (changes: ChangesType[]) => void;
export type FlowsContextType = {
//keep
saveFlow: (flow?: FlowType, silent?: boolean) => Promise<void>;
tabId: string;
//keep
isLoading: boolean;
setTabId: (index: string) => void;
//keep
flows: Array<FlowType>;
deleteNode: (idx: string | Array<string>) => void;
deleteEdge: (idx: string | Array<string>) => void;
//keep
removeFlow: (id: string) => void;
//keep
addFlow: (
newProject: boolean,
flow?: FlowType,
@ -25,7 +30,9 @@ export type FlowsContextType = {
flowName: string,
flowDescription?: string
) => void;
//keep
downloadFlows: () => void;
//keep
uploadFlows: () => void;
isBuilt: boolean;
setIsBuilt: (state: boolean) => void;