How to use the @shopgate/pwa-common/actions/router.historyPop function in @shopgate/pwa-common

To help you get started, we’ve selected a few @shopgate/pwa-common 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 / commerce / scanner / actions / handleQrCode.js View on Github external
pathname: link,
      }));
      break;
    case QR_CODE_TYPE_SEARCH:
      if (await dispatch(handleSearch(data.searchPhrase || ''))) {
        dispatch(successHandleScanner(scope, format, payload));
      } else {
        notFound();
      }
      break;
    case QR_CODE_TYPE_COUPON:
      dispatch(successHandleScanner(scope, format, payload));
      dispatch(historyReplace({
        pathname: link,
      }));
      dispatch(historyPop());
      break;
    case QR_CODE_TYPE_PRODUCT:
    case QR_CODE_TYPE_PRODUCT_WITH_COUPON:
      // Force to fetch missing products
      await dispatch(fetchProductsById([data.productId]));

      // Check from a store
      if (!getProductById(getState(), data)) {
        notFound();
      } else {
        dispatch(successHandleScanner(scope, format, payload));
        dispatch(historyReplace({
          pathname: link,
        }));
      }
      break;
github shopgate / pwa / themes / theme-gmd / pages / WriteReview / subscriptions.js View on Github external
subscribe(successReviewSubmit$, ({ dispatch, events }) => {
    dispatch(historyPop());
    events.emit(ToastProvider.ADD, {
      id: 'reviews.success_message',
      message: 'reviews.success_message',
    });
  });
github shopgate / pwa / themes / theme-ios11 / pages / WriteReview / subscriptions.js View on Github external
subscribe(successReviewSubmit$, ({ dispatch, events }) => {
    dispatch(historyPop());
    events.emit(ToastProvider.ADD, {
      id: 'reviews.success_message',
      message: 'reviews.success_message',
    });
  });