How to use the @shopgate/pwa-common-commerce/product/selectors/product.getCurrentBaseProductId 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 / pages / Reviews / subscriptions.js View on Github external
subscribe(reviewsRouteDidEnter$, ({ dispatch, getState }) => {
    const currentCount = getCurrentReviewCount(getState());
    if (currentCount >= REVIEW_ITEMS_PER_PAGE) {
      // No need to fetch.
      return;
    }
    dispatch(fetchReviews(getCurrentBaseProductId(getState()), REVIEW_ITEMS_PER_PAGE));
  });
}
github shopgate / pwa / pages / WriteReview / subscriptions.js View on Github external
subscribe(reviewsRouteDidEnter$, ({ dispatch, getState }) => {
    const state = getState();
    const productId = getCurrentBaseProductId(state);

    if (!state.user.login.isLoggedIn) {
      return;
    }
    // Only dispatch when review is not yet in store
    dispatch(getUserReview(productId));
  });
github shopgate / pwa / pages / Product / subscriptions.js View on Github external
subscribe(routeDidEnter(ITEM_PATH), ({ dispatch, getState }) => {
    const productId = getCurrentBaseProductId(getState());
    dispatch(getProduct(productId));
  });
github shopgate / pwa / pages / Product / subscriptions.js View on Github external
subscribe(shouldFetchReviews$, ({ dispatch, getState }) => {
      const baseProductId = getCurrentBaseProductId(getState());
      if (baseProductId) {
        dispatch(getProductReviews(baseProductId, REVIEW_PREVIEW_COUNT));
      }
    });
  }
github shopgate / pwa / themes / theme-ios11 / pages / Product / actions / getProductData.js View on Github external
(dispatch, getState) => {
    const state = getState();
    const currentProductId = getCurrentBaseProductId(state);
    const productId = selectedVariantId || currentProductId;

    if (!productId) {
      return;
    }

    dispatch(requestProductData(productId, selectedVariantId));
    dispatch(getProduct(productId));
  };
github shopgate / pwa / themes / theme-gmd / pages / Reviews / components / LoadMore / connector.js View on Github external
const mapStateToProps = (state, props) => ({
  currentReviewCount: getCurrentReviewCount(state, props),
  isFetching: getReviewsFetchingState(state, props),
  productId: getCurrentBaseProductId(state, props),
  totalReviewCount: getReviewsTotalCount(state, props),
});
github shopgate / pwa / pages / Reviews / components / LoadMore / connector.js View on Github external
const mapStateToProps = state => ({
  currentReviewCount: getCurrentReviewCount(state),
  isFetching: getReviewsFetchingState(state),
  productId: getCurrentBaseProductId(state),
  totalReviewCount: getReviewsTotalCount(state),
});
github shopgate / pwa / pages / WriteReview / components / ReviewForm / connector.js View on Github external
const mapStateToProps = state => ({
  authorName: getDefaultAuthorName(state),
  productId: getCurrentBaseProductId(state),
  review: getUserReviewForProduct(state),
  isLoadingUserReview: getUserReviewFirstFetchState(state),
});
github shopgate / pwa / themes / theme-ios11 / pages / Reviews / components / LoadMore / connector.js View on Github external
const mapStateToProps = (state, props) => ({
  currentReviewCount: getCurrentReviewCount(state, props),
  isFetching: getReviewsFetchingState(state, props),
  productId: getCurrentBaseProductId(state, props),
  totalReviewCount: getReviewsTotalCount(state, props),
});
github shopgate / pwa / pages / Product / components / VariantSelects / connector.js View on Github external
const mapStateToProps = state => ({
  variants: getProductVariants(state),
  currentBaseProductId: getCurrentBaseProductId(state),
  currentProductVariantId: getCurrentProductVariantId(state),
  getVariantsByProductId: productId => getVariantsByProductId(state, null, productId),
});

@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