The Problems Redux Toolkit Tries to Solve
Understand how the Redux toolkit eliminates the common problems with Redux development in general.
Boilerplate Code
The problems RTK attempts to solve become apparent as soon as you start building Redux apps with RTK. Let’s look at the number one culprit.
The number one complaint I get from Redux users is how much boilerplate code they write with Redux. I’ve heard and read that too many times but understandably so.
As developers, we are focused on solving problems efficiently. Spending unnecessary time writing boilerplate code is far from efficient. Like an uncomfortable itch, it’s hard to live with wiring boilerplates all the time.
The truth is that before RTK, there have been many open-source libraries created to help take away some pain associated with Redux. And with writing boilerplate code, it is the lead character!
However, with RTK, you can get a solution from the official maintainers of Redux. RTK is touted as the intended way to write modern Redux logic.
More than just reducing boilerplate code, RTK aims to address other problems, such as the difficulty in creating reducers and creating a store with multiple actors. With creating string constants and endless switch cases, this can be a hassle.
Well, look no further. The Redux toolkit addresses these very common problems.
In the spirit of fairness, I have to mention that no one drug cures all pains. So, the Redux toolkit may not solve all of yours. It is limited in scope, but it definitely solves a lot of the aforementioned problems. You would still have to address concerns such as folder structure and data caching. There is no running away from caching, eh?
However, I’ll discuss some best practices as we build example applications in the course.
What’s included in the Redux toolkit?
Remember that I said RTK was a toolset comprising utility functions to make Redux development easier? The rest of the course is dedicated to taking a deep look at these utility functions, but let’s take a quick peek into them.
The Redux toolkit main dependencies
To be completely honest, you could skip this section and move on to the next. The next section is more important if you care about the exposed APIs that the Redux toolkit provides.
Okay, for the nerds, let’s talk about the inner libraries employed by Redux toolkit. For RTK to deliver its promises of a better Redux development, it also employs help from some reputable open-source libraries.
You don’t need a degree to know what the main dependencies are. You just need a package.json
.
Get hands-on with 1400+ tech skills courses.