|
|
|
|
|
by TeMPOraL
1957 days ago
|
|
I thought TFA meant flashing in the metaphorical sense - it's the code paths that light up, not things on the screen. Circular dependencies are an unfortunate fact of life, and I wish we had tools to deal with them, instead of desperately trying to avoid them. A good test for a UI paradigm is, how do you handle a UI like this: A = [50] [====| ]
B = [10] [| ]
C = [60] [=====| ]
A + B = C
Where [===| ] things are sliders, all three are changeable, and the relation A+B=C must always hold. |
|
The easiest solution is to maintain a fixed order of preference, something like:
The alternative is to maintain the latest selections made by the user and use that as the iteration order.Whatever approach you go with, the "single source of truth" approach of react/vue/svelte + state (whether it is state in hooks, redux, mobx or whatever) holds. The "values" above is the source of truth, and the components just reflect that.
In other words: from a state point of view you don't have three sliders each with a value but a "three-valued component that happens to be shown as three sliders".