|
|
|
|
|
by d--b
1654 days ago
|
|
This is rather vague. Let's take a more concrete example: Let's say you want to add a button somewhere that hides/shows another widget. Surely you don't want to go to the backend to do that? So how do you do it? With the store approach, clicking the button creates an action, that modifies the store (changing a visibility parameter somewhere) and repaints the UI. In the diagram there is no flow back from the "API" box to the widgets. Though it still something that needs to happen. The "API" necessarily contains some state, at least to track which component needs which data. |
|
That's a good case. This is purely UI state, right? (we don't store it on the server).
For UI state we still need to depend on prop-drilling or State Management solutions.
In the article I'm mainly talking about the Data which exist on Backend (as you can also see from all the pictures). In my experience such Server data is 90-95% of all data in most UI applications and that data contributes the most to the complexity.
Pure UI state is often just a fraction of the the whole State and is's often synchronous, so managing it should not be complex. So this kind of coupling will still exist.
To clarify, I do not say Widgets should be 100% independent. We do not achieve complete decoupling. But moving Server Data under control of Widgets gives us closer to this.