How to use the @shopgate/pwa-core/classes/PipelineDependencies.set function in @shopgate/pwa-core

To help you get started, we’ve selected a few @shopgate/pwa-core 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 / favorites / subscriptions / index.js View on Github external
subscribe(appDidStart$, ({ dispatch }) => {
    // Setup sync pipeline dependencies (concurrency to each other and themselves)
    pipelineDependencies.set(SHOPGATE_USER_ADD_FAVORITES, [
      SHOPGATE_USER_ADD_FAVORITES,
      SHOPGATE_USER_DELETE_FAVORITES,
    ]);
    pipelineDependencies.set(SHOPGATE_USER_DELETE_FAVORITES, [
      SHOPGATE_USER_ADD_FAVORITES,
      SHOPGATE_USER_DELETE_FAVORITES,
    ]);

    dispatch(fetchFavorites());
  });
github shopgate / pwa / libraries / commerce / cart / subscriptions / index.js View on Github external
subscribe(appDidStart$, ({ dispatch }) => {
    pipelineDependencies.set(pipelines.SHOPGATE_CART_GET_CART, [
      pipelines.SHOPGATE_CART_ADD_PRODUCTS,
      pipelines.SHOPGATE_CART_UPDATE_PRODUCTS,
      pipelines.SHOPGATE_CART_DELETE_PRODUCTS,
      pipelines.SHOPGATE_CART_ADD_COUPONS,
      pipelines.SHOPGATE_CART_DELETE_COUPONS,
    ]);

    // Push (deeplink) with coupon concurrent to get cart on app start
    pipelineDependencies.set(pipelines.SHOPGATE_CART_ADD_COUPONS, [
      pipelines.SHOPGATE_CART_ADD_PRODUCTS,
      pipelines.SHOPGATE_CART_GET_CART,
    ]);
    pipelineDependencies.set(pipelines.SHOPGATE_CART_DELETE_COUPONS, [
      pipelines.SHOPGATE_CART_ADD_PRODUCTS,
      pipelines.SHOPGATE_CART_GET_CART,
    ]);

    /**
     * Reload the cart whenever the WebView becomes visible.
     * This is needed, for example, when the cart is modified from another inAppBrowser tab like a
     * web-checkout and the user closes the said tab before reaching the success page.
     */
    event.addCallback('viewWillAppear', () => {
      dispatch(fetchCart());
    });

    // Reset the productPendingCount on app start to avoid a wrong value in the cart badge.
    dispatch(setCartProductPendingCount(0));
  });
github shopgate / pwa / libraries / commerce / cart / subscriptions / index.js View on Github external
subscribe(appDidStart$, ({ dispatch }) => {
    pipelineDependencies.set(pipelines.SHOPGATE_CART_GET_CART, [
      pipelines.SHOPGATE_CART_ADD_PRODUCTS,
      pipelines.SHOPGATE_CART_UPDATE_PRODUCTS,
      pipelines.SHOPGATE_CART_DELETE_PRODUCTS,
      pipelines.SHOPGATE_CART_ADD_COUPONS,
      pipelines.SHOPGATE_CART_DELETE_COUPONS,
    ]);

    // Push (deeplink) with coupon concurrent to get cart on app start
    pipelineDependencies.set(pipelines.SHOPGATE_CART_ADD_COUPONS, [
      pipelines.SHOPGATE_CART_ADD_PRODUCTS,
      pipelines.SHOPGATE_CART_GET_CART,
    ]);
    pipelineDependencies.set(pipelines.SHOPGATE_CART_DELETE_COUPONS, [
      pipelines.SHOPGATE_CART_ADD_PRODUCTS,
      pipelines.SHOPGATE_CART_GET_CART,
    ]);
github shopgate / pwa / libraries / commerce / favorites / subscriptions / index.js View on Github external
subscribe(appDidStart$, ({ dispatch }) => {
    // Setup sync pipeline dependencies (concurrency to each other and themselves)
    pipelineDependencies.set(SHOPGATE_USER_ADD_FAVORITES, [
      SHOPGATE_USER_ADD_FAVORITES,
      SHOPGATE_USER_DELETE_FAVORITES,
    ]);
    pipelineDependencies.set(SHOPGATE_USER_DELETE_FAVORITES, [
      SHOPGATE_USER_ADD_FAVORITES,
      SHOPGATE_USER_DELETE_FAVORITES,
    ]);

    dispatch(fetchFavorites());
  });
github shopgate / pwa / libraries / commerce / cart / subscriptions / index.js View on Github external
subscribe(appDidStart$, ({ dispatch }) => {
    pipelineDependencies.set(pipelines.SHOPGATE_CART_GET_CART, [
      pipelines.SHOPGATE_CART_ADD_PRODUCTS,
      pipelines.SHOPGATE_CART_UPDATE_PRODUCTS,
      pipelines.SHOPGATE_CART_DELETE_PRODUCTS,
      pipelines.SHOPGATE_CART_ADD_COUPONS,
      pipelines.SHOPGATE_CART_DELETE_COUPONS,
    ]);

    // Push (deeplink) with coupon concurrent to get cart on app start
    pipelineDependencies.set(pipelines.SHOPGATE_CART_ADD_COUPONS, [
      pipelines.SHOPGATE_CART_ADD_PRODUCTS,
      pipelines.SHOPGATE_CART_GET_CART,
    ]);
    pipelineDependencies.set(pipelines.SHOPGATE_CART_DELETE_COUPONS, [
      pipelines.SHOPGATE_CART_ADD_PRODUCTS,
      pipelines.SHOPGATE_CART_GET_CART,
    ]);

    /**
     * Reload the cart whenever the WebView becomes visible.
     * This is needed, for example, when the cart is modified from another inAppBrowser tab like a
     * web-checkout and the user closes the said tab before reaching the success page.
     */
    event.addCallback('viewWillAppear', () => {
      dispatch(fetchCart());
    });