Hacker News new | past | comments | ask | show | jobs | submit login

Actually, custom getters and setters exist in ES5:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guid...

AmpersandJS, for example, implements its observable pattern in this way:

http://ampersandjs.com/learn/state

That said, I don't think the pubsub/rx/observables pattern is the most optimal for UI development, since it still allows for cascading event chains. Modeling all application state as a large data structure that allows for efficient diffing — which nicely mirrors the diffing react does with both it's internal component tree and diffing with the DOM — is a much more straightforward approach. Just re-render your application 60 times a second, like a game engine, and make that process as efficient as possible.




This is exactly where I am hoping reactive ui ends up. If you don't want to do 60 times a second you can render only on certain events like network call or mouseover. If you do the rendering in requestAnimationFrame you can batch things easily.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: