3 ms·
Have you used redux-sagas on any projects before this one? How do you feel it compares with redux-thunk? I've used redux-thunk for all of my past projects but
by vevoe 7y ago
Have you used redux-sagas on any projects before this one? How do you feel it compares with redux-thunk?
I've used redux-thunk for all of my past projects but recently inherited a project using sagas. It seems to be pretty unorganized and I'm wondering how much effort I should put into cleaning it up, if it's even possible.
- socceroos 7y agoI far prefer redux-sagas personally. I find the generator/yield style to really reduce the mental overhead of a saga's flow as compared to a thunk.
- Merad 7y agoHave you tried thunks using async/await? IMO its all the benefits of being easy to read and understand without having to learn a totally new concept (generators).
- acemarke 7y agoYep, agreed. The biggest missing capability there is being able to _respond_ to dispatched actions, which thunks can't do. But, most apps don't immediately need to do that anyway.
- acemarke 7y agoSagas are an incredibly powerful tool... and 95% of Redux apps don't need them. Most apps should stick with thunks until they truly have a need for very complex async logic. See this Redux FAQ entry for more details: https://redux.js.org/faq/actions#what-async-middleware-should-i-use-how-do-you-decide-between-thunks-sagas-observables-or-something-else https://redux.js.org/faq/actions#what-async-middleware-shoul...