Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate Collection and Variable Store #258

Open
SoulKa opened this issue Feb 9, 2025 · 0 comments
Open

Consolidate Collection and Variable Store #258

SoulKa opened this issue Feb 9, 2025 · 0 comments
Labels
backend Backend related task enhancement New feature or request

Comments

@SoulKa
Copy link
Collaborator

SoulKa commented Feb 9, 2025

Is your feature request related to a problem? Please describe.
We have a collection store and a variable store. The first has a full collection in it, including collection variables, environments and all requests etc. The latter is responsible for temporarily modifying collection variables. Both are ultimately modifying the same data (collection variables). This is bad.

Describe the solution you'd like
Since the variable store is basically included in the collection store, we should consolidate them. The simplest solution would be:

  1. Create a setVariables(variables: VariableMap) method in the collection store which overrides/sets the variables property of the collection
  2. Move the functionality of the variable store into the state of VariableTab (temporarily adding variables, modifying them etc.). Only save() needs to call the new setVariables() action on the collection store

Describe alternatives you've considered
Instead of making VariableTab stateful, I considered moving the methods into collection store. This will bloat the store with methods which are only used by the VariableTab. I don't like this alternative :D

Additional context
Zustand is a monolithic store library. The provided solution is compliant to that.

@SoulKa SoulKa added backend Backend related task enhancement New feature or request labels Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Backend related task enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant