Most things that people build
don't need anything like this.
True. It would be great to show examples of websites that benefit from the complexity of an extra library to handle client side state. I would think less then 1% do.For example, lets look at how HN handles state syncing. Function "toggle" in this file handles collapsing/expanding threads:
https://news.ycombinator.com/hn.js
function toggle (ev, id) {
var on = !afind($(id), collapsed());
(on ? addClass : remClass)($(id), 'coll');
recoll();
if ($('logout')) {
new Image().src = 'collapse?id=' + id + (on ? '' : '&un=true');
}
ev.stopPropagation();
return false;
}
How would the react+redux approach look like? Is it really worth it?