
export default function reducer(state={
  fetching: false,
  fetched: false,
  <%= name %>: [],
  error: null
}, action) {
  switch(action.type) {

    case "FETCH_<%= actionName %>_PENDING": {
      return {...state,
        fetching: true
      };
      break;
    }
    case "FETCH_<%= actionName %>_REJECTED": {
      return {...state,
        fetching: false,
        error: action.payload
      };
      break;
    }
    case "FETCH_<%= actionName %>_FULFILLED": {
      return {...state,
        fetching: false,
        fetched: false,
        <%= name %>: [...state.<%= name %>]
      };
      break;
    }

  }

  return state;
}

@@ -60,28 +60,27 @@
 %0A  fetched: 
-fals
+tru
 e,%0A  %3C%25= nam
@@ -233,16 +233,40 @@
 ng: true
+,%0A        fetched: false
 %0A      %7D
@@ -374,32 +374,55 @@
 etching: false,%0A
+        fetched: true,%0A
         error: a
@@ -577,20 +577,19 @@
 etched: 
-fals
+tru
 e,%0A     

fix reducer issue with fetched and fetching