How to use @magento/venia-concept - 1 common examples

To help you get started, we’ve selected a few @magento/venia-concept 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 magento-research / venia-consumer-example / src / veniaDrivers.js View on Github external
export function resourceUrl(href, opts = {}, ...rest) {
  let url = veniaResourceUrl(href, opts, ...rest);
  try {
    url = new window.URL(url);
  } catch (e) {
    const isImage = opts.type && opts.type.startsWith("image");
    const base = isImage
      ? process.env.REACT_APP_VENIA_BASE_DOMAIN
      : window.location.origin;
    url = new window.URL(url, base);
  }
  const params = new URLSearchParams(url.search);
  params.append("referrer", window.location.hostname);
  url.search = `?${params}`;
  return url.href;
}

@magento/venia-concept

Venia PWA Concept Storefront for Magento 2

OSL-3.0
Latest version published 2 months ago

Package Health Score

82 / 100
Full package analysis

Popular @magento/venia-concept functions

Similar packages