@arcteryx/container-cart
v7.0.0
Published
Arc'teryx Cart Container
Downloads
1,070
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 { SomeCartProvider } from '@arcteryx/data-providers';
import React, { useRef } from 'react';
function Page() {
const flyinCartRef = useRef();
const cartService = SomeCartProvider({ ...settings })
return (
<>
<FlyInCartContainer
cartService={cartService}
ref={flyinCartRef}
errorLogger={newRelic}
/>
<button
onClick={() => flyinCartRef.current.addToCart({ cartId, id: productNo, sku })}
/>
</>
);
}