Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Interesting approach.

I would still rather connect to RethinkDB with a frontend service and push those to stores and have the component watch the store.

Because while this might work for a small use case, a real world usage will quickly outgrow that and you will wish you hadn't stuffed such functionality in a display component.

So this is probably most useful for quick sketches and debugging stuff.



Could you elaborate on this? This project seems to be moving in the same direction the React team is with Relay and GraphQL – the component describes the query it requires to render itself, and a query/caching layer executes the query automatically.


What I described as a Service would be what this query/caching layer is. I would just rather not have it embedded in the Component, making it harder to follow what a Component does. The beauty of them is that they are simple to read and understand. The more mixins you use, the more esoteric it gets and you have to read a bunch of code to understand why the render function magically has these properties to display with.

Another point would be that the service or store could be re-used in more than just react, and it can be tested without having to consider the UI.




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

Search: