Show HN: React Resolver – Async Rendering and Data-Fetching for React
1–10 of 11 posts
Re: Show HN: React Resolver – Async Rendering and Data-Fetching for React
#2Re: Show HN: React Resolver – Async Rendering and Data-Fetching for React
#3Re: Show HN: React Resolver – Async Rendering and Data-Fetching for React
#4Nice to see some effort in this area. How is it compatible with the flux architecure?
Re: Show HN: React Resolver – Async Rendering and Data-Fetching for React
#5Is React Resolver related to React Nexus[1]? [1] https://github.com/elierotenberg/react-nexus
It looks like we've landed on about the same architectural solution given React's synchronous nature.
I'll have to check it out in more detail as, to be honest, I was more aware of the Nexus Flux library.
Re: Show HN: React Resolver – Async Rendering and Data-Fetching for React
#6Re: Show HN: React Resolver – Async Rendering and Data-Fetching for React
#7Nice to see some effort in this area. How is it compatible with the flux architecure?
I have a very large application in production now using a custom flux implementation (since the flux wars have finally died down Alt & Redux taking the lead).
There'll be some documentation & examples around Redux specifically, but the gist is you'd do something like this (not using any Flux library in particular here):
// Flux - watch UserStore for changes & provide "props.userStore".
@connectToStore(UserStore)
// Flux - provide actions as props for the resolver or component to use.
@bindActions(function(dispatcher) {
return {
create: dispatcher.actions.User.create,
save: dispatcher.actions.User.save,
};
})
// Resolver -
@resolve("user", function({ create, userStore }) {
return userStore.getCurrent() || create("New User");
})
// Now your component always has the latest, updated user
export default UserProfile extends React Component {
Watch the repo for some more examples, as there'll be both Alt & Redux examples.Re: Show HN: React Resolver – Async Rendering and Data-Fetching for React
#8Nice to see some effort in this area. How is it compatible with the flux architecure?
Seems incompatible to me. You don't fetch data inside the components when you're using Flux.
How you choose to fetch data is up to you, whether you use Flux, or fire AJAX calls within the `@resolve` function.
That's your code, not mine. I just make it so you can put your data requirements _beside_ your component instead of several layers up :)
Re: Show HN: React Resolver – Async Rendering and Data-Fetching for React
#9Earlier quoted context omitted.
Seems incompatible to me. You don't fetch data inside the components when you're using Flux.
but isn't the plan with Relay to do just that? or not?
This is why React Resolver was created, and from what I've seen, also spurred React Nexus & React Transmit as well.
On an related note, v1 of React Resolver explicitly stated how it was similar to Relay with regards to fetching data for components. I've since dropped that messaging to avoid confusion since Relay isn't even available yet :)