|
|
|
|
|
by moritzwarhier
806 days ago
|
|
> Most importantly: OP is right re: vanilla example is most legible. Reading the proposal, I have no idea what this "Signal" word adds other than complexity. The aim is to run computations or side effects only when the values they depend on change. This is a perfectly normal scenario and you don't want to update all data the UI of a full application tree whenever something changes. DOM updates are the most popular example but it could really be anything. Of course in simple examples (e.g. this counter) you might not care about recomputing every value and recreating every part of the DOM (apart from issues with focus and other details). But in general, some form of this logic is needed by every JS-heavy reactive web app. Regardless of the implementation, when it comes to that, I'm not sure I see the benefit of building this into the language either. |
|