Re:An overview of JavaScript reactive frameworks
by ThrustVectoring on Sunday June 07, 2015 @10:43AM
(#9674795)
Much like Javascript's "==" operator gives you type conversion for "free", it's not clear to me that getting two-way binding for "free" is a good thing. One-way binding is significantly easier to reason about.
[ Parent
| on HN ]
Re:An overview of JavaScript reactive frameworks
by dkempner on Sunday June 07, 2015 @01:01PM
(#9675421)
Most of the time, data binding IS one-way when using Knockout.
Input field? That's one-way from display => a variable in your viewmodel.
P tag? That's one-way from variable in viewmodel => display.
But when do you really need two-way data binding? Form validation and formatting. Man, this stuff is hard even with two-way data binding. You have to be able to accept, parse, format, and validate all in the same element. It's very helpful to be able to use knockout for a task like this.