This is going to be a quick one, but should help you out with error handling with your redux application.

One of the issues in using redux is its use of strings in the actions folder. Take for example this very simple action creator…

You wanna do what now?

You’ll notice that the type isn’t listed as a string, which is convention in redux. The inherent issue here is that strings are typically not going to throw errors during your development process, and can make it very difficult to find any spelling issues or other user-created bugs.

So the suggestion is a simple one: Create a new file that’s only purpose is to convert these strings into variables.

Oh I get it.

You can have an entire file of these conversions, in the hope that they will save you time in the future. Now, if you have a spelling error while calling one of your actions, you’ll get that sweet, sweet error message you’ve been looking for. This will surely save you time in having to comb over your code to find the error.

This was a quick one, but a powerful one!