src/util.js
function normalizeTypeDescriptors(types) {
  let [requestType, successType, failureType] = types;

  if (typeof requestType === 'string' || typeof requestType === 'symbol') {
    requestType = { type: requestType };
  }

  if (typeof successType === 'string' || typeof successType === 'symbol') {
    successType = { type: successType };
  }
  successType = {
    payload: (action, state, res) => getJSON(res),
    ...successType
  };

  if (typeof failureType === 'string' || typeof failureType === 'symbol') {
    failureType = { type: failureType };
  }
  failureType = {
    payload: (action, state, res) =>
      getJSON(res).then(json => new ApiError(res.status, res.statusText, json)),
    ...failureType
  };

  return [requestType, successType, failureType];
}
function normalizeTypeDescriptors(types) {
  let [requestType, successType, failureType] = types;

  if (typeof requestType === 'string' || typeof requestType === 'symbol') {
    requestType = { type: requestType };
  }

  if (typeof successType === 'string' || typeof successType === 'symbol') {
    successType = { type: successType };
  }
  successType = {
    payload: (action, state, res) => getJSON(res),
    ...successType
  };

  if (typeof failureType === 'string' || typeof failureType === 'symbol') {
    failureType = { type: failureType };
  }
  failureType = {
    payload: (action, state, res) =>
      getJSON(res).then(json => new ApiError(res.status, res.statusText, json)),
    ...failureType
  };

  return [requestType, successType, failureType];
}
function normalizeTypeDescriptors ( types ) { let [ requestType , successType , failureType ] = types ; if ( typeof requestType === 'string' || typeof requestType === 'symbol' ) { requestType = { type : requestType } ; } if ( typeof successType === 'string' || typeof successType === 'symbol' ) { successType = { type : successType } ; } successType = { payload : ( action , state , res ) => getJSON ( res ) , ... successType } ; if ( typeof failureType === 'string' || typeof failureType === 'symbol' ) { failureType = { type : failureType } ; } failureType = { payload : ( action , state , res ) => getJSON ( res ) . then ( json => new ApiError ( res . status , res . statusText , json ) ) , ... failureType } ; return [ requestType , successType , failureType ] ; }
Blow up string or symbol types into full-fledged type descriptors,
and add defaults

@function normalizeTypeDescriptors
@access private
@param {array} types - The [RSAA].types from a validated RSAA
@returns {array}
Blow up string or symbol types into full - fledged type descriptors and add defaults