Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR centralizes the state management into the zustand store. out store now only exposes a select number of actions, each of which update different parts of the state structure. Before we had a large number of actions that only updates a limited part of the slice/state, and we relied on react hooks to make sure the actions stayed in sync. As a result, we has instances where nodes where created but the edges remained.
In addition, we now only create nodes and edges in the store when necessary (we still hold the entire decision tree in state as a config then create nodes and edges from it as necessary). This opens the door to taking action on changes like
onNodesChange
oronEdgesChange
.Issue ticket number and link
Checklist