You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry to turns this to a "+1 thread", but +1 from me as well. Though I'm probably going to start (trying to) implementing react-resolver + redux in next few weeks so if no one else have done the example before that, I might be able to put together something... though I'm pretty new to React ecosystem, so not sure if my examples will be any good :D
I'm using redux with redux-api-middleware. With @connect I can easily bind my store to the components but I haven't found a nice way to provide the initial state for the store. I'm also using (read: trying to use) server-side rendering with multiple routes (react-router) and code splitting so I was thinking if react-resolver could solve the problem to populate the state based on current route component. :)
A better solution might be to use redux-promise (more discussion: redux #99). Using that I think it would be possible to call the needed async actions on @resolve and return an asyncAction() or Promise.all(asyncActions). That way the component will have its initial data in redux store before rendering. Somewhat similar what @erikras does with fetchData. I will try this later.
@RanzQ that's a great idea. maybe it'd be possible to chain @connect with @resolve so that the props passed to @resolve have the action creators and state necessary for loading data. Using this strategy would require us to somehow pass the state/creators through to the react component.
Activity
josebalius commentedon Aug 20, 2015
+1 looking forward to the redux example
aripalo commentedon Aug 21, 2015
Sorry to turns this to a "+1 thread", but +1 from me as well. Though I'm probably going to start (trying to) implementing react-resolver + redux in next few weeks so if no one else have done the example before that, I might be able to put together something... though I'm pretty new to React ecosystem, so not sure if my examples will be any good :D
ericclemmons commentedon Aug 21, 2015
It's cool, I'm using:
:)
ericclemmons commentedon Aug 21, 2015
Which...actually didn't work haha.
Thanks for your support! I'll be doing some TDD tonight for this (Tequila Driven Development).
josebalius commentedon Aug 21, 2015
@ericclemmons best kind of development right there! lol
aripalo commentedon Aug 21, 2015
Hahaha I might be doing
npm install redux --save& keeping up the Ballmer Peak with some Beer Driven Development as well :Darush commentedon Aug 26, 2015
well in that case, +1
ericclemmons commentedon Sep 14, 2015
This should also how how to handle #82
RanzQ commentedon Sep 19, 2015
I'm using redux with redux-api-middleware. With
@connectI can easily bind my store to the components but I haven't found a nice way to provide the initial state for the store. I'm also using (read: trying to use) server-side rendering with multiple routes (react-router) and code splitting so I was thinking ifreact-resolvercould solve the problem to populate the state based on current route component. :)Just sharing my thoughts. +1
RanzQ commentedon Sep 19, 2015
A better solution might be to use redux-promise (more discussion: redux #99). Using that I think it would be possible to call the needed async actions on
@resolveand return anasyncAction()orPromise.all(asyncActions). That way the component will have its initial data in redux store before rendering. Somewhat similar what @erikras does with fetchData. I will try this later.jachenry commentedon Sep 21, 2015
@RanzQ that's a great idea. maybe it'd be possible to chain @connect with @resolve so that the props passed to @resolve have the action creators and state necessary for loading data. Using this strategy would require us to somehow pass the state/creators through to the react component.
anaibol commentedon Oct 22, 2015
+1
sars commentedon Dec 31, 2015
+1
AriaFallah commentedon Feb 3, 2016
So is there any example usage with redux?
sars commentedon Feb 3, 2016
@AriaFallah I use https://github.com/Rezonans/redux-async-connect ...
It works good with redux
AriaFallah commentedon Feb 3, 2016
@sars Thanks! I'll take a look