{"size": 1385, "ext": "js", "max_stars_repo_path": "app/containers/TriviaApp/actions.js", "max_stars_repo_name": "mrbigfish/business_website", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/containers/TriviaApp/actions.js", "max_issues_repo_name": "mrbigfish/business_website", "max_issues_repo_issues_event_min_datetime": "2020-04-05T17:54:02.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-24T04:47:41.000Z", "max_forks_repo_path": "app/containers/TriviaApp/actions.js", "max_forks_repo_name": "mrbigfish/business_website", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 5, "max_forks_count": null, "avg_line_length": 14.8924731183, "max_line_length": 60, "alphanum_fraction": 0.6137184116}
import {
  GET_QUESTIONS,
  QUESTIONS_RECEIVED,
  QUESTIONS_ERROR,
  ANSWER_CORRECT,
  ANSWER_WRONG,
  UPDATE_COUNT,
  RESET_COUNT,
  UPDATE_DIFFICULTY,
  RESET_GAME,
} from './constants'

export function getQuestions() {
  return {
    type: GET_QUESTIONS,
  }
}

export function questionsReceived(questions) {
  return {
    type: QUESTIONS_RECEIVED,
    questions,
  }
}

export function questionsError(error) {
  return {
    type: QUESTIONS_ERROR,
    error,
  }
}

export function answerCorrect(correct, result, score) {
  return {
    type: ANSWER_CORRECT,
    correct,
    result,
    score,
  }
}

export function answerWrong(wrong, result) {
  return {
    type: ANSWER_WRONG,
    wrong,
    result,
  }
}

export function updateCount(count, result, answerClicked) {
  return {
    type: UPDATE_COUNT,
    count,
    result,
    answerClicked,
  }
}

export function updateDifficulty(difficulty) {
  return {
    type: UPDATE_DIFFICULTY,
    difficulty,
  }
}

export function resetCount(count) {
  return {
    type: RESET_COUNT,
    count,
  }
}

export function resetGame(
  count,
  result,
  difficulty,
  isPlaying,
  wrong,
  correct,
  score,
) {
  return {
    type: RESET_GAME,
    count,
    result,
    difficulty,
    isPlaying,
    wrong,
    correct,
    score,
  }
}
