Dima Kambalin
Dima Kambalin

Reputation: 357

What should I use redux-saga or redux-thunk in 2021?

Which one should I use? For more context I use redux-toolkit. Advices to help understand which tool fits better are appreciated

Upvotes: 2

Views: 3215

Answers (1)

phry
phry

Reputation: 44086

The Redux Styleguide very clearly recommends thunks over slices for most asynchronous logic. If you have very complex and intertwined logic, sagas might make sense, but most applications don't have that kind of logic.

Also, you should probably try out using RTK-Query which would reduce your need for either middleware for asynchronous tasks quite a bit.

Upvotes: 5

Related Questions