How to use the @shopgate/pwa-common-commerce/product/selectors/product.getProductsResult function in @shopgate/pwa-common-commerce

To help you get started, we’ve selected a few @shopgate/pwa-common-commerce examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github shopgate / pwa / libraries / tracking / streams / search.js View on Github external
.switchMap((data) => {
    const { getState } = data;
    const query = getCurrentSearchQuery(getState());

    // Check if products for the current route are already available within Redux.
    const productsLoaded = getProductsResult(
      getState(),
      { searchPhrase: query }
    ).totalProductCount !== null;

    if (!productsLoaded) {
      // Wait for incoming products if they are not available yet.
      return resultsReceived$.first();
    }

    return Observable.of(data);
  })
  .merge(searchRouteReappeared$);
github shopgate / pwa / libraries / tracking / streams / category.js View on Github external
.switchMap((data) => {
    const { action, getState } = data;
    const { categoryId } = action.route.params;

    // Check if products for the current route are already available within Redux.
    const productsLoaded = getProductsResult(
      getState(),
      { categoryId: hex2bin(categoryId) }
    ).totalProductCount !== null;

    if (!productsLoaded) {
      // Wait for incoming products if they are not available yet.
      return productsReceived$.first();
    }

    return Observable.of(data);
  });
github shopgate / pwa / pages / Category / connector.js View on Github external
const mapStateToProps = (state, props) => ({
  category: getCurrentCategory(state, props),
  hasHeadline: !isCategoryEmpty(state, props),
  hasProducts: getCategoryProductCount(state) > 0,
  isFilterBarShown: isFilterBarShown(state),
  isRoot: !getCurrentCategoryId(state, props),
  ...getProductsResult(state, props),
});
github shopgate / pwa / themes / theme-ios11 / pages / Search / components / Products / connector.js View on Github external
const mapStateToProps = (state, props) => ({
  ...getProductsResult(state, props),
});
github shopgate / pwa / themes / theme-ios11 / pages / Category / components / Products / connector.js View on Github external
const mapStateToProps = (state, props) => ({
  ...getProductsResult(state, props),
});
github shopgate / pwa / pages / Search / connector.js View on Github external
const mapStateToProps = state => ({
  isLoading: isViewLoading(state, SEARCH_PATH),
  isFilterBarShown: isFilterBarShown(state),
  searchPhrase: getSearchPhrase(state),
  ...getProductsResult(state),
});
github shopgate / pwa / pages / Category / components / Products / connector.js View on Github external
const mapStateToProps = state => ({
  ...getProductsResult(state),
});

@shopgate/pwa-common-commerce

Commerce library for the Shopgate Connect PWA.

Apache-2.0
Latest version published 1 month ago

Package Health Score

76 / 100
Full package analysis