Search code examples
reduxredux-sagaredux-thunkredux-toolkit

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


Solution

  • 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.