src/index.js
function _createAction(action) {
  if (_isString(action)) {
    action = {
      destination: action,
    }
  }
  if (_isObject(action)) {
    action = (function() {
      const openNewTab = action.openNewTab
      const destination = action.destination
      return function() {
        if (openNewTab) {
          window.open(destination, '_blank')
        } else {
          window.location.href = destination
        }
      }
    })()
  }

  return action
}
function _createAction(action) {
  if (_isString(action)) {
    action = {
      destination: action,
    }
  }
  if (_isObject(action)) {
    action = (function() {
      const openNewTab = action.openNewTab
      const destination = action.destination
      return function() {
        if (openNewTab) {
          window.open(destination, '_blank')
        } else {
          window.location.href = destination
        }
      }
    })()
  }

  return action
}
function _createAction ( action ) { if ( _isString ( action ) ) { action = { destination : action , } } if ( _isObject ( action ) ) { action = ( function ( ) { const openNewTab = action . openNewTab const destination = action . destination return function ( ) { if ( openNewTab ) { window . open ( destination , '_blank' ) } else { window . location . href = destination } } } ) ( ) } return action }
Transforms the given action into an action
callback.
@param {Function|object|string} action
@returns {WishAction}
@private
Transforms the given action into an action callback .