Functions
[useProductListing(props)] ⇒ [ProductListingTalonProps]
This talon contains logic for a component that renders a list of products for a cart. It performs effects and returns prop data to render the component on a cart page.
This talon performs the following effects:
- Fetch product listing data associated with the cart
- Log any GraphQL errors to the console
[useProduct(props)] ⇒ [ProductTalonProps]
This talon contains logic for a product component used in a product listing component. It performs effects and returns prop data for that component.
This talon performs the following effects:
- Manage the updating state of the cart while a product is being updated or removed
[useEditModal()] ⇒ [EditModalTalonProps]
This talon contains logic for a product edit modal used on a cart page. It returns prop data for rendering an interactive modal component.
[deriveOptionSelectionsFromProduct(props)] ⇒ [ProductFormTalonProps]
This talon contains logic for a product edit form. It performs effects and returns data for rendering the component inside a modal container.
This talon performs the following effects:
- Manage the updating state of the cart while form data is being saved
- Set the variant price on a product depending on the product's options
Typedefs
[ProductListingQueries] : Object
GraphQL queries for getting product listing data. This is a type used in the useProductListing talon.
[ProductListingTalonProps] : Object
Object type returned by the useProductListing talon. It provides props data for a component that renders a product list.
[ProductMutations] : Object
GraphQL mutations for a product in a cart. This is a type used by the useProduct talon.
[ProductTalonProps] : Object
Object type returned by the useProduct talon. It provides prop data for rendering a product component on a cart page.
[ProductItem] : Object
Data about a product item in the cart. This type is used in the ProductTalonProps type returned by the useProduct talon.
[QuantityTalonProps] : Object
Object type returned by the useQuantityStepper talon. It provides props data for a quantity UI component.
[EditModalTalonProps] : Object
Object type returned by the useEditModal talon. It provides props data for rendering an edit modal component.
[ProductFormTalonProps] : Object
Object type returned by the useProductForm talon. It provides props data for a product form UI component inside a modal.
This talon contains logic for a component that renders a list of products for a cart. It performs effects and returns prop data to render the component on a cart page.
This talon performs the following effects:
- Fetch product listing data associated with the cart
- Log any GraphQL errors to the console
Returns: Parameters
ObjectProductListingQueriesExample (Importing into your project)
import { useProductListing } from '@magento/peregrine/lib/talons/CartPage/ProductListing/useProductListing';
This talon contains logic for a product component used in a product listing component. It performs effects and returns prop data for that component.
This talon performs the following effects:
- Manage the updating state of the cart while a product is being updated or removed
Returns: Parameters
ObjectProductItemProductMutationsfunctionfunctionExample (Importing into your project)
import { useProduct } from '@magento/peregrine/lib/talons/CartPage/ProductListing/useProduct';
This talon contains logic for a product edit modal used on a cart page. It returns prop data for rendering an interactive modal component.
Returns: Example (Importing into your project)
import { useEditModal } from '@magento/peregrine/lib/talons/CartPage/ProductListing/EditModal/useEditModal';
This talon contains logic for a product edit form. It performs effects and returns data for rendering the component inside a modal container.
This talon performs the following effects:
- Manage the updating state of the cart while form data is being saved
- Set the variant price on a product depending on the product's options
Returns: Parameters
ObjectObjectGraphQLDocumentfunctionfunctionGraphQLDocumentGraphQLDocumentfunctionExample (Importing into your project)
import { useProductForm } from '@magento/peregrine/lib/talons/CartPage/ProductListing/EditModal/useProductForm';
GraphQL queries for getting product listing data. This is a type used in the useProductListing talon.
See: productListingFragments.js for the queries used in Venia
Properties
GraphQLDocumentObject type returned by the useProductListing talon. It provides props data for a component that renders a product list.
Properties
ObjectbooleanError | nullArray.<Object>functionGraphQL mutations for a product in a cart. This is a type used by the useProduct talon.
See: product.js to see the mutations used in Venia
Properties
GraphQLDocumentGraphQLDocumentObject type returned by the useProduct talon. It provides prop data for rendering a product component on a cart page.
Properties
StringfunctionfunctionfunctionbooleanProductItemData about a product item in the cart. This type is used in the ProductTalonProps type returned by the useProduct talon.
Properties
StringStringStringArray.<Object>numbernumberStringStringObject type returned by the useQuantityStepper talon. It provides props data for a quantity UI component.
Properties
booleanbooleanfunctionfunctionfunctionfunctionObject type returned by the useEditModal talon. It provides props data for rendering an edit modal component.
Properties
functionObject type returned by the useProductForm talon. It provides props data for a product form UI component inside a modal.
Properties
ObjectArray.<Error>functionfunctionbooleanbooleanbooleanfunctionStringSource Code: pwa-studio/packages/peregrine/lib/talons/CartPage/ProductListing/useProductListing.js