"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.callbacksCompleteForCall = exports.errorCallFor = exports.successCallFor = exports.startCallFor = void 0;

var _constants = require("@instructure/quiz-common/lib/constants");

var callAction = function callAction(callStatus, type) {
  return {
    type: _constants.CALL_STATUS,
    payload: {
      call: type,
      status: callStatus
    }
  };
};

var startCallFor = function startCallFor(type) {
  return callAction('calling', type);
};

exports.startCallFor = startCallFor;

var successCallFor = function successCallFor(type) {
  return callAction('success', type);
};

exports.successCallFor = successCallFor;

var errorCallFor = function errorCallFor(type) {
  return callAction('error', type);
};

exports.errorCallFor = errorCallFor;

var callbacksCompleteForCall = function callbacksCompleteForCall(type) {
  return {
    type: _constants.SET_CALLBACKS_STATUS,
    payload: {
      call: type,
      status: 'complete'
    }
  };
};

exports.callbacksCompleteForCall = callbacksCompleteForCall;