Handling saga IO from within callbacks
See original GitHub issueYielding a call to a function that is using a callback to run its post execution behavior: yield apply(someObject, someFunction)
Seems I can’t yield put
from someFunction
since the callback isn’t a generator. How can I dispatch an action from that callback?
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
How to "yield put" in redux-saga within a callback?
One possible solution, as you already mentioned, is to use channels . Here is an example that should work in your case:
Read more >API Reference - Redux-Saga
Spawns a saga on each action dispatched to the Store that matches pattern . After spawning a task once, it blocks until spawned...
Read more >Handle Side-Effects With Redux-Saga - Frontend - Scalac.io
Project showing how to move all side-effects away from action-creators. In a way that makes them as clean as possible with Redux-Saga.
Read more >3.10. Attributes and Callbacks — SAGA 1.18.0 documentation
All objects using the Attribute Interface allow to register a callback for any changes of its attributes, such as 'state' and 'state_detail'. Those...
Read more >Redux-Saga race conditions - Medium
Asynchronous program flow is a well known feature in JavaScript environments. All of us extensively use callbacks, Promises at the ...
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
addEventListener calls its callback with the event as a first parameter. cps’s callback is called with the event as a first argument by addEventListener, since cps expects an error first argument. it treats the event as an error.
I’d opt for your first solution but would remove the event listener after the promise is resolved
Hi @yelouafi !
Thanks for your awesome work, but I have a question here: how to remove listeners in the automatically canceled race effects?