@arcteryx/container-cart

Arc'teryx Cart Container

Usage no npm install needed!

<script type="module">
  import arcteryxContainerCart from 'https://cdn.skypack.dev/@arcteryx/container-cart';
</script>

README

container-cart

The data fetching module is the wrapper that contains the @arcteryx/components-cart react component. This module houses the various business logic and service calls that @arcteryx/components-cart demands, in order to create a layer of separation from the presentational component.

Usage

FlyInCartContainer

import { FlyInCartContainer } from '@arcteryx/container-cart';
import { CartTasServiceProvider } from '@arcteryx/data-providers';
import React, { useRef } from 'react';

function Page() {
    const flyinCartRef = useRef();
    const cartService = CartTasServiceProvider({ tasServiceUrl: 'https://o-qa.arcteryx.com', tasBasicAuthHeader: 'abcd1234efgh5678==', country: 'ca', language: 'en' })

    return (
        <>
            <FlyInCartContainer
                cartService={cartService}
                ref={flyinCartRef}
                errorLogger={newRelic}
            />
            <button
                onClick={() => flyinCartRef.current.addToCart({ cartId, id: productNo, sku })}
            />
        </>
    );
}