Module 540737

932 characters · in 9e23ebb73a75b187.js
Dependencies
Required by (2)
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,r){r.d(t,{jn:()=>C,tu:()=>_});var n=r(228366),l=r(181658),i=r(773669),s=r(927813),o=r(371794),a=r(821925),u=r(103348),c=r(652215);let d=12*s.A.Millis.HOUR,f=10*s.A.Millis.MINUTE;function C(e){if(!e)return!1;let t=a.A.getFetchStateForSku(e);if("loading"===t)return!1;let r=a.A.getFetchedAtForSku(e);return null==r||Date.now()-r>("error"===t?f:d)}async function _(e){let{skuIds:t,ignoreCache:r=!1}=e,s=t.filter(C);if(0!==s.length)try{n.h.dispatch({type:"STOREFRONT_PRODUCTS_BY_SKU_IDS_FETCH",skuIds:s});let e=await (0,o.aP)({url:c.Rsh.STOREFRONT_PRODUCTS_BY_SKU_IDS,query:{sku_ids:s,locale:i.default.locale,with_bundled_skus:!0,include_google_sku_ids:!1,ignore_cache:r},rejectWithError:!0});n.h.dispatch({type:"STOREFRONT_PRODUCTS_BY_SKU_IDS_FETCH_SUCCESS",skuIds:s,products:e.body.products.map(u.A.fromServer)})}catch(e){n.h.dispatch({type:"STOREFRONT_PRODUCTS_BY_SKU_IDS_FETCH_FAILURE",skuIds:s,apiError:new l.A(e)})}}}