chore: cleanup broken tests, add extra documentation, make sure everything is clean and code style isn't inconsistant
This commit is contained in:
@@ -47,6 +47,12 @@ const initialEdges: Edge[] = [
|
||||
{ id: 'phase-1-end', source: 'phase-1', target: 'end' },
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* How we have defined the functions for our FlowState.
|
||||
* We have the normal functionality of a default FlowState with some exceptions to account for extra functionality.
|
||||
* The biggest changes are in onConnect and onDelete, which we have given extra functionality based on the nodes defined functions.
|
||||
*/
|
||||
const useFlowStore = create<FlowState>((set, get) => ({
|
||||
nodes: initialNodes,
|
||||
edges: initialEdges,
|
||||
@@ -56,7 +62,6 @@ const useFlowStore = create<FlowState>((set, get) => ({
|
||||
set({nodes: applyNodeChanges(changes, get().nodes)}),
|
||||
onEdgesChange: (changes) => set({ edges: applyEdgeChanges(changes, get().edges) }),
|
||||
|
||||
// Let's make sure we tell the nodes when they're connected, and how it matters.
|
||||
onConnect: (connection) => {
|
||||
const edges = addEdge(connection, get().edges);
|
||||
const nodes = get().nodes;
|
||||
|
||||
Reference in New Issue
Block a user