Using redux-observable
See original GitHub issueI read almost entirely the apollo client docs and I couldn’t find anything on using redux-observable with it.
I know the usual way to make queries with apollo is with the connect()
method connecting the query and the class but with redux-observable, you need to be able to call the query/mutation directly in the epic
which is in a different js file.
Basically we would have to call the query in the epic and if it’s successful, update redux store and return the query information received to the component. Else we would return nothing. I see no way of doing this in my current implementation because only the component knows the query.
Do you guys have already thought about a way you could integrate redux-observable with apollo or is it on hold for now? Thank you(First time posting an ‘issue’)
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Introduction · redux-observable
RxJS-based middleware for Redux. Compose and cancel async actions to create side effects and more. https://redux-observable.js.org. Note: this project is quite ...
Read more >Reactive Apps with Redux, RxJS, and Redux-Observable
redux -observable is a library for handling asynchronous tasks in Redux. It works by capturing a dispatched action from Redux and does some...
Read more >A beginner's guide to redux-observable - LogRocket Blog
Redux -Observable is a Redux middleware that allows you to filter and map actions using RxJS operators. RxJS operators like filter() and ...
Read more >Should I use redux-observable? Also what is it? Also let's be ...
redux -observable is a powerful framework. It effectively decouples the ui of a project from it's behaviors, and guides it toward a more ......
Read more >Redux-Observable will solve your state problems. - ITNEXT
Redux-Observable is an amazingly powerful middleware for Redux using RxJS. Using Redux-Observable requires knowing or learning RxJS which is itself a major ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@loganpowell It’s not a problem. Yes this approach has worked out fine so far. I recommend it to anyone using both apollo-client and redux-observable together.
Ok I successfully changed the actionCreator logic to mutate using the client directly.
I use
return
here to call my reducer and then update my redux store.Thank you for your help 😃