UNPKG

@shopgate/pwa-common

Version:

Common library for the Shopgate Connect PWA.

15 lines 1.02 kB
import{RECEIVE_URL,REQUEST_URL,ERROR_URL}from"../../constants/ActionTypes";/** * Creates the dispatched RECEIVE_URL action object. * @param {string} urlType The url type. * @param {string} url The requested url. * @param {number|null} [expires=null] The expires date of the url. * @returns {Object} The dispatched action object. */export var receiveUrl=function receiveUrl(urlType,url){var expires=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;return{type:RECEIVE_URL,url:url,urlType:urlType,expires:expires};};/** * Creates the dispatched REQUEST_URL action object. * @param {string} urlType The url type. * @returns {Object} The dispatched action object. */export var requestUrl=function requestUrl(urlType){return{type:REQUEST_URL,urlType:urlType};};/** * Creates the dispatched ERROR_URL action object. * @param {string} urlType The url type. * @returns {Object} The dispatched action object. */export var errorUrl=function errorUrl(urlType){return{type:ERROR_URL,urlType:urlType};};