adr/0004-using-redux-to-replace-mvvm.md
Date: 2024-09-05
Approved
We had some pilot (see 0003-redux-pilot.md), and we now want to use Redux (if dealing with state); moving away from MVVM.
We will now use Redux (if dealing with state); moving away from MVVM.
Actions are now classes. This simplifies the data we want to present in all or many cases and removes the need for ActionContext on each action enums.
When creating action types, lean towards using user and API action names over state change names. We want our actions to read clearly on what action was taken and not the consequence of the action. The view should not know the consequences. Actions are called currently on main thread
The store will automatically ensure actions are executed on the main thread so we don’t need to add another check for main thread
We are adopting Redux on the team to utilize the benefits of structuring information in a single directional flow and maintaining state.