1

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

Dima Kambalin
  • 283
  • 2
  • 12
  • 1
    An argument could be made for thunk since that is what [react redux toolkit](https://redux-toolkit.js.org/introduction/getting-started#whats-included) uses. Saga is less tightly bound but difficult to use to solve practical problems unless you are very comfortable with it. Thunk would be easier to adopt and learn. – HMR Jul 14 '21 at 18:19

1 Answers1

4

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.

phry
  • 35,762
  • 5
  • 67
  • 81