<commit_before>import {
  FETCH_CATEGROY,
  FETCH_CATEGROY_ERROR
} from './types';

const initialState = {
  about: [],
  error: false,
  family: [],
  home: [],
  message: '',
  portrait: [],
  travel: [],
  wedding: []
};

/**
 * carouselReducer(arg1, arg2)
 * - @param {Object} state (initialState)
 * - @param {Object} action
 * - @return {Object} state (new instance)
 * - NOTE:
 * - type = String
 * - name = String
 * - data = Object { error, message, [name] }
 */
export default (state = initialState, action) => {
  console.log(action);
  const { data, name, type } = action;
  switch (type) {
    case FETCH_CATEGROY:
      return {
        ...state,
        [name]: name
        // message: data.message
      };
    case FETCH_CATEGROY_ERROR:
      return { ...state, error: data.error, message: data.message };
    default:
      return state;
  }
};<commit_msg>Updated initialState. All data being processed like I want it.<commit_after>import { FETCH_CATEGROY, FETCH_CATEGROY_ERROR } from './types';

const initialState = {
  error: false,
  message: ''
};

/**
 * carouselReducer(arg1, arg2)
 * - @param {Object} state
 * - @param {Object} action
 * - @return {Object} state
 */
export default (state = initialState, action) => {
  const { data, name, type } = action;
  switch (type) {
    case FETCH_CATEGROY:
      return {
        ...state,
        [name]: data.category.photos,
        message: data.message
      };
    case FETCH_CATEGROY_ERROR:
      return {
        ...state,
        error: data.error,
        message: data.message
      };
    default:
      return state;
  }
};
{'fraction_non_alphanumeric': 0.14872433105164903, 'fraction_numerical': 0.002489110143123833, 'mean_word_length': 2.5185995623632387, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5981826', 'n_tokens_mistral': 544, 'n_tokens_neox': 540, 'n_words': 133}