4 ms·
Looks nice for a short example, but later you'd also need some stuff like: let button = new Button("Click me"); window.attach(button, {position: 'cente
by uryga 8y ago
Looks nice for a short example, but later you'd also need some stuff like:
let button = new Button("Click me");
window.attach(button, {position: 'center'});
To me, imperative widget creation gets tedious and hard to read pretty fast. I'm not a fan of the many parsing layers involved in the JS example either, but I really appreciate the declarativity they enable.
- c-smile 8y agoI am not saying that you don't need markup at all. Window content can still use markup. But it is not clear why do you need it for defining Application and Window abstractions. In browsers DOM element is a subject of style applicability and events handling. But why do you need DOM nodes for application and window ?
- always_good 8y agoWhat does your trivial wrapper actually improve though? window = (...children) => <App><Window>{...children}</App></Window> Over the years I've learned that some boilerplate isn't bad. In fact it means App and Window are implemented in the same abstraction that I'm using.