Thinking in Redux (when all you’ve known is MVC)
Mikhail Levkovsky
26215

Its good to make comparisons like this article makes. For myself, I still think that MVC is always there even if it’s being dished out in new ways like MVI or MVVM.

For instance, Vue is a MVVM that can have the model side extended via Vuex, a elegant modular store solution with it’s actions, mutations and getters. I’ve come to understand that these actions (similar to Redux actions) are not the kind of actions I had in mind for my app.

In a CRUD type of scenario they might be controller-ish but nowhere close to the kind of controller flow I need for my SPA. Controller to me means the total flow from capturing events to invoking handlers to calling on Vuex/Redux actions that in turn call mutations and then using getters to inject the state back into the components that are interested.

Along this flow I can also use RxJS and function libraries, whatever suits my requirements. I find working in the Vue MVVM framework interesting in this regard, because they say they don’t really have a controller. It is just suppose to be this reactivity system, just a super clean and robust version of “view being a function of state”.

You might say that the Vue (the view) and the Vuex (the model) sides are like the Yin and Yang sides of a circle, while the controller is the curvy S shape running right through the middle of it all. If a app does more than push a few buttons it does not take long to appreciate the full meaning of the important role a controller plays.

Anyways, I’m having fun forging my controller solution and the lack of one in modern frameworks just means I get to draw my S curve precisely where I want it.

Show your support

Clapping shows how much you appreciated Mvsica Donvm Dei’s story.