{"size": 880, "ext": "js", "max_stars_repo_path": "src/modules/output-lang.js", "max_stars_repo_name": "mongodb-js/compass-export-to-language", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/modules/output-lang.js", "max_issues_repo_name": "mongodb-js/compass-export-to-language", "max_issues_repo_issues_event_min_datetime": "2018-06-05T10:44:52.000Z", "max_issues_repo_issues_event_max_datetime": "2021-03-09T17:34:14.000Z", "max_forks_repo_path": "src/modules/output-lang.js", "max_forks_repo_name": "isabella232/compass-export-to-language", "max_forks_repo_forks_event_min_datetime": "2021-01-28T11:26:36.000Z", "max_forks_repo_forks_event_max_datetime": "2021-01-28T11:26:36.000Z"}
{"max_stars_count": null, "max_issues_count": 5, "max_forks_count": 1, "avg_line_length": 20.4651162791, "max_line_length": 67, "alphanum_fraction": 0.6875}
/**
 * The prefix.
 */
const PREFIX = 'export-to-language/output-lang';

/**
 * OutputLang changed action.
 */
export const OUTPUT_LANG_CHANGED = `${PREFIX}/OUTPUT_LANG_CHANGED`;

/**
 * The initial state.
 */
export const INITIAL_STATE = 'python';

/**
 * Reducer function for handle state changes to outputLang.
 *
 * @param {String} state - The outputLang state.
 * @param {Object} action - The action.
 *
 * @returns {String} The new state.
 */
export default function reducer(state = INITIAL_STATE, action) {
  if (action.type === OUTPUT_LANG_CHANGED) {
    return action.outputLang;
  }

  return state;
}

/**
 * Action creator for outputLang changed events.
 *
 * @param {String} outputLang - The outputLang value.
 *
 * @returns {Object} The outputLang changed action.
 */
export const outputLangChanged = (outputLang) => ({
  type: OUTPUT_LANG_CHANGED,
  outputLang
});
