Open snamiki1212 opened 3 years ago
Once I tried to replace Plain JavaScript Object to Class but it didn't work because we need to think more and a ready for replacing it. I'm listing below what we have to do before going on.
Redux cannot handle instances of the class so has to use Plain JavaScript Object. UI layer will use Class so we have to create Transform Layer between UI Layer and Redux Layer.
To begin with, as best practice, reducer should be a pure function( at least should be referential transparency). But, some reducer has a dependency of Model that's meaning we need refactor before replacing tasks. Otherwise, I need to handle complicated tasks when replacing tasks so I want to split each task into small and tackling before going on.
- Refactor reducer to be a pure function
https://github.com/snamiki1212/plangoab/issues/99 Done through developing test, as well as fixed to be referencial transparency at least. So we can start this task whenever.
Overview
In terms of the model of core logic in Plangoab, we implemented using not a class but plain JS object because of reason as part of some experiment. However, I finally realized this way is absolutely inferior so going to replace it. https://github.com/snamiki1212/plangoab/blob/main/doc/ARCHITECTURE.md#no-class-but-function
Packages
Choosing below pkg because of handling with Object immutably.
State of Redux
The state of redux can only plain js object so need to convert instance and plain js object when to input/output.
Persist of Redux
redux-persist
so I need to make an adjustment of stakeholders before going on this task or deploy.Targets
ARCHITECTURE.md
/calendar
/event
/resource
/story