// This function generates the five statuses from a single CRUD action.
// For instance, you'd probably pass "CREATE", "READ", "UPDATE", or "DELETE"
// as `crudAction`.
const mapConstant = (resourceName, crudAction) => ({
  [`${crudAction}_${resourceName}`]: `${crudAction}_${resourceName}`,
  [`${crudAction}_${resourceName}_SUCCEED`]: `${crudAction}_${resourceName}_SUCCEED`,
  [`${crudAction}_${resourceName}_FAIL`]: `${crudAction}_${resourceName}_FAIL`,
  [`${crudAction}_${resourceName}_NULL`]: `${crudAction}_${resourceName}_NULL`,
});

const createTypes = mapConstant('RESOURCES', 'CREATE');
const readTypes = mapConstant('RESOURCES', 'READ');
const updateTypes = mapConstant('RESOURCES', 'UPDATE');
const deleteTypes = mapConstant('RESOURCES', 'DELETE');

export default {
  ...createTypes,
  ...readTypes,
  ...updateTypes,
  ...deleteTypes
};

@@ -187,22 +187,8 @@
  = (
-resourceName, 
 crud
@@ -219,31 +219,25 @@
 Action%7D_
-$%7BresourceName%7D
+RESOURCES
 %60%5D: %60$%7Bc
@@ -247,31 +247,25 @@
 Action%7D_
-$%7BresourceName%7D
+RESOURCES
 %60,%0A  %5B%60$
@@ -273,39 +273,33 @@
 crudAction%7D_
-$%7BresourceName%7D
+RESOURCES
 _SUCCEED%60%5D: 
@@ -313,31 +313,25 @@
 Action%7D_
-$%7BresourceName%7D
+RESOURCES
 _SUCCEED
@@ -347,39 +347,33 @@
 crudAction%7D_
-$%7BresourceName%7D
+RESOURCES
 _FAIL%60%5D: %60$%7B
@@ -384,31 +384,25 @@
 Action%7D_
-$%7BresourceName%7D
+RESOURCES
 _FAIL%60,%0A
@@ -415,39 +415,33 @@
 crudAction%7D_
-$%7BresourceName%7D
+RESOURCES
 _NULL%60%5D: %60$%7B
@@ -456,23 +456,17 @@
 on%7D_
-$%7BresourceName%7D
+RESOURCES
 _NUL
@@ -506,29 +506,16 @@
 onstant(
-'RESOURCES', 
 'CREATE'
@@ -547,29 +547,16 @@
 onstant(
-'RESOURCES', 
 'READ');
@@ -588,29 +588,16 @@
 onstant(
-'RESOURCES', 
 'UPDATE'
@@ -635,21 +635,8 @@
 ant(
-'RESOURCES', 
 'DEL

Simplify action type generation code