2 ms·
I like the one-way bindings myself, but one thing I've never reconciled with the one-way is the one-true-way view is that in a one-way only world you tend to wi
by spankalee 11y ago
I like the one-way bindings myself, but one thing I've never reconciled with the one-way is the one-true-way view is that in a one-way only world you tend to wire up more event listeners to deal with data changes and inputs, and those listeners can be all over the place with arbitrary side-effects.
A two-way binding ends up being shorthand for a specific type of event handler with a known side-effect, making them easier to find and reason about.
Maybe I'm missing some other aspect to the one-way-only view though.
- michaelsbradley 11y agoArbitrary side-effects can be a recipe for problems, definitely. One-way flow is, to my mind, best used in conjunction with persistent data structures and some tangible mechanism to coordinate state changes under a single reference, or a small set of references.