Adding support for dispatching Sagas from Action Creators (like in redux-thunk)
See original GitHub issueIs there a functionality we lose if we would simply do dispatch(mySaga)
instead of registering all the sagas in middleware on the store creation step
Issue Analytics
- State:
- Created 8 years ago
- Comments:24 (19 by maintainers)
Top Results From Across the Web
Different Ways to Dispatch Actions with Redux
In this guide, we'll look at different ways of dispatching the action and at isolating the components from Redux.
Read more >Understanding Redux Saga: From action creators to sagas
Redux Thunk allows an action creator to dispatch a function in addition to a plain object, converting the action creator into a thunk....
Read more >Understanding Asynchronous Redux Actions with ...
Learn how to use the Redux Thunk middleware to run asynchronous operations, talk to an API and dispatch actions to the store.
Read more >Writing Logic with Thunks
Each thunk typically requires defining three different action types + matching action creators for "pending/fulfilled/rejected", plus the actual ...
Read more >Understanding redux-saga: From action creators to sagas
Since the middleware automatically passes the dispatch function to the function that the action creator returns, for the component, there will ...
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
@yelouafi Thank you for the example. Below I have pasted a working middleware.
Here is an example of dispatching a generator…
https://github.com/kloy/saga-playground/blob/master/src/index.js#L33
This is not meant as a good example of when to dispatch a generator, just a way for me to prove the functionality.
I’ll close this. As I don’t plan to add dispatching to the core. Let me know If someone would like to contribute a separate middleware for this.