When developing with Redux, often times we spend time on a lot of boilerplate code, and some common logic tend to become repeated. We can use Meta pattern to avoid code repetition while still taking advantage of Redux features. It is a simple concept and works like this:
In actions we define the actual type in meta
property with name
and type
fields instead of type
property. So a action looks like so:
{
meta: {
// Use logic/flow of this action
type: STATIC_TYPE_NAME