Refactor to use Action Type Constants and Action Creators when Dispatching Redux Actions

Share this video with your friends

Send Tweet

This lesson covers the use of action type constants and action creators.

Action type constants are common in legacy redux apps, but aren't strictly required. I find it's slightly better to include these constants in the slice files alongside the reducers and action creators that reference them.

Action creators are much more helpful and serve as a public API for sending actions into your reducer. They can help clean up messy dispatch statements and reduce the code needed to dispatch events.

Overall there's nothing very complicated about these two techniques, they're just common patterns in redux that are important to learn.

I strongly suggested studying the redux style guide for more insight into how to use these (and other) patterns effectively.

vassiliskrikonis
vassiliskrikonis
~ 3 years ago

At around the 2:09 mark of "Refactor to use Action Type Constants and Action Creators when Dispatching Redux Actions" video there's overlapping audio :-/

Friedrich
Friedrich
~ 3 years ago

yep the audio is overlapping

Lucas Minter
Lucas Minter
~ 3 years ago

You guys are correct. We will get on it right away.