News for hackers. Stuff that matters.
Re:Render realtime RethinkDB results in React by crucialfelix on Saturday July 04, 2015 @09:56AM (#9830145)
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.

Re:Render realtime RethinkDB results in React by zachallaun on Saturday July 04, 2015 @12:00PM (#9830510)
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.
Re:Render realtime RethinkDB results in React by crucialfelix on Saturday July 04, 2015 @02:44PM (#9831159)
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.