Other Solutions
Learn other solutions to the side effects issue.
There are numerous solutions for handling side effects maintained by the Redux community, so why reinvent the wheel? We would encourage you to do your research and play with different approaches before you commit to any of them, however. The larger the project, the harder and more stressful it is to change an existing approach to managing side effects.
Every third-party library has its learning curve and scalability potential. While redux-thunk
and redux-promise
might be very easy to learn, they become painful to use as a project grows. Conversely, libraries like redux-observable
or redux-saga
scale better but require learning new concepts, like sagas
and RxJS
(which may or may not be a problem, depending on the prior knowledge of your team and the level of experience of the engineers working on the project).
In this course, we concentrate on using middleware to handle side effects because of the benefits it offers: it’s closer to the existing tooling available in Redux, supports most use cases, and does not require additional libraries.
If you decide to try going in the lean middleware direction, it might be useful to get your team familiar with the common design patterns described in the next section. You might even be unconsciously using them in your applications, as they are obvious and logical ways to organize events in a system.
Get hands-on with 1400+ tech skills courses.