-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redux integration #1041
Comments
This is generally not a very good idea. Userland extensions shouldn't rely on user to use a particular third-party middleware. Make your own middleware if you'd like, but don't force user to use Redux Thunk. |
@gaearon, So I should integrate a middleware of my creation into the package? I just thought it would be easier to use one thats already made. |
User might already be using middleware that's incompatible with Redux Thunk. |
Anyway, it's hard to say more because the code snippet you posted does not fully describe the API you implement. |
@gaearon Thank you for the feedback 😄! |
Well, @gaearon currently that is the only exposed part of the API its inner working are like so: import transport from ('./utils/transport.js');
function reachGraphQL (path, query, queryParams = {}, actionCreator) {
return async dispatch => {
try{
let response = await transport(path, query, queryParams);
dispatch(actionCreator(response.data));
} catch (error) {
console.log(error)
}
}
} The transport import is using |
I still don't understand the API. Maybe we should wait for README for your project and then we can comment on it :-) |
@gaearon will do. |
@gaearon heres the repo, I just published the beta. http://www.github.com/kennetpostigo/react-reach |
I don't see where you rely on thunk middleware. You |
Thank you :) |
Hello,
I'm currently working on a small lib that easily enables people to integrate GraphQL into your redux workflow. Using it would look like this:
It depends on the user to utilize
redux-thunk
when creating a store. Once it executes it dispatches the actionAction creator that was passed in.I wanted to ask if there is anything that comes to mind that I should consider that I may have over looked.
The text was updated successfully, but these errors were encountered: