discussion about refactoring the global state
- Dominant language
- TypeScript
- Stars
- 80
- Forks
- 34
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 36
Description
@lpatiny @targos
this ticket to discuss the state refactoring and see what is the best approach for the refactoring and take an example case
we are planning to reorganize the main state and distribute it into 3 new state
1- Data State: contains the data that is saved in the JSON
2- Display State: contains everything related to what is displayed and how it is displayed
3- Data Processing State: contains data that is temporarily calculated
when it was in a single state it was easy to manipulate the data and make the changes and after we plan to distribute the state logically it become unclear to me what the best way to do it was because as I mention there is a big interference.
for example
if we need to drag and drop .nmrium file inside NMRium the following procedure should happen
1- add the spectra in the global state
2- update the domain in the Display state and check the spectra if it is a fid then set the spectra in the center, ....etc
3- if it is 2d spectra we calculate the contours.
and there are more complex actions but I put this as an example to see how the three reducers should communicate and in which order they should be listed
DataProvider => DisplayProvider =>DataProcessingProvider
this is an old sheet for the same discussion for further details
https://hackmd.io/ughPPAtNRbGI2KAWrvNPOQ?both
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.