by galaxyLogic · 3y ago · 0 comments
Views subscribe with the model to get notifications about changes to different "aspects" of the model. When they get a change-notification they update themselves by asking the model for its latest data for a given aspect.
The reason why solutions like React are so popular is because it radically simplifies state management: data flows in from the top of the component hierarchy down. When a component makes changes to state, those changes are queued up for the next consistent render loop, which ensures that nothing renders in an intermediate state. An entire class of bugs, gone.
I think it should be only the Controller which changes the Model. That can cause views which are dependent on the "aspect" of the model that was changed to update themselves.
But a view updating itself should NOT cause the model to change and thus not cause a cascade of other views causing other views to change.
(googling 'thing mobx' where 'thing' is your preferred rendering system has results in quite a lot of cases)