js-stack-from-scratch
js-stack-from-scratch copied to clipboard
Async Redux library (redux-thunk alternatives)
Hi. Thank you for this amazing tutorial.
Why have you chosen redux-thunk over redux-saga?
Good question :)
Generators might be a little too intense for people who are not well-versed in JS, and redux-thunk is kind of the "official" way to deal with async actions. The Redux chapter is already the most difficult one. I might replace it by redux-saga in the future if there is a strong demand though.
Did you consider Redux Pack ?
The fact that there is 2 different libraries proposed in 2 messages, answers by itself :) Redux-thunk is the logical way to go for a beginner as it's in the Redux doc and most of the tutorials are using it.
...and here's a third candidate: redux-promise :)
I agree that Redux Thunk is the best choice for basic async workflow. I don't see enough benefit to be using Redux Saga unless the async behaviour becomes quite complex.
Hello,
To enrich the current thinking, I would greatly appreciate to invite you to a further reading of the following post : What is the right way to do asynchronous operations in Redux? – Decembersoft
Très cordialement / Best Regards,
I thought redux-observable is a worthy alternative