@shopgate/pwa-common-commerce 7.5.0-beta.6 → 7.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopgate/pwa-common-commerce",
3
- "version": "7.5.0-beta.6",
3
+ "version": "7.5.0",
4
4
  "description": "Commerce library for the Shopgate Connect PWA.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Shopgate <support@shopgate.com>",
@@ -19,8 +19,8 @@
19
19
  "reselect": "^3.0.1"
20
20
  },
21
21
  "devDependencies": {
22
- "@shopgate/pwa-common": "7.5.0-beta.6",
23
- "@shopgate/pwa-core": "7.5.0-beta.6",
22
+ "@shopgate/pwa-common": "7.5.0",
23
+ "@shopgate/pwa-core": "7.5.0",
24
24
  "lodash": "^4.17.4",
25
25
  "react": "~16.12.0",
26
26
  "react-dom": "~16.12.0"
@@ -3,4 +3,7 @@ function _extends(){_extends=Object.assign||function(target){for(var i=1;i<argum
3
3
  * @param {string} productId The product ID.
4
4
  * @param {boolean} forceFetch Skips shouldFetchData check. Always fetches.
5
5
  * @return {Function} A redux thunk.
6
- */function fetchProduct(productId){var forceFetch=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return function(dispatch,getState){var state=getState();var product=getProductById(state,{productId:productId});if(!forceFetch&&!shouldFetchData(product)){if(product.productData){dispatch(receiveProductCached(product.productData));}return undefined;}var path=getCurrentPathname(state);LoadingProvider.setLoading(path);var requestParams=_extends({},configuration.get(DEFAULT_PRODUCTS_FETCH_PARAMS),{productId:productId});dispatch(requestProduct(productId,forceFetch));var request=new PipelineRequest(SHOPGATE_CATALOG_GET_PRODUCT).setInput(requestParams).dispatch();request.then(function(result){LoadingProvider.unsetLoading(path);dispatch(receiveProduct(productId,result));})["catch"](function(error){LoadingProvider.unsetLoading(path);dispatch(errorProduct(productId,error.code));});return request;};}/** @mixes {MutableFunction} */export default mutable(fetchProduct);
6
+ */function fetchProduct(productId){var forceFetch=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return function(dispatch,getState){var state=getState();var product=getProductById(state,{productId:productId});if(!forceFetch&&!shouldFetchData(product)){if(product.productData){/*
7
+ This timeout is needed here to make sure receivedVisibleProduct$ comes after
8
+ productWillEnter$. Otherwise productIsReady$ is not working correctly.
9
+ */setTimeout(function(){dispatch(receiveProductCached(product.productData));},0);}return undefined;}var path=getCurrentPathname(state);LoadingProvider.setLoading(path);var requestParams=_extends({},configuration.get(DEFAULT_PRODUCTS_FETCH_PARAMS),{productId:productId});dispatch(requestProduct(productId,forceFetch));var request=new PipelineRequest(SHOPGATE_CATALOG_GET_PRODUCT).setInput(requestParams).dispatch();request.then(function(result){LoadingProvider.unsetLoading(path);dispatch(receiveProduct(productId,result));})["catch"](function(error){LoadingProvider.unsetLoading(path);dispatch(errorProduct(productId,error.code));});return request;};}/** @mixes {MutableFunction} */export default mutable(fetchProduct);