String Constants
Learn the drawbacks of using string literals, and how string constants help address those issues
We'll cover the following...
In the example application, we discussed the idea of using string constants. To better illustrate the reasoning behind this approach, let’s consider the problems that using strings for type
can cause in a large code base:
Spelling mistakes
: If we misspell the same string in the action or the reducer, our action will fire but result in no changes to the
ERROR message