useCartEvents

cart · /react·function

Subscribe to a single cart event type for the lifetime of the calling component. Re-subscribes whenever type or handler identity changes — stabilize the handler with useCallback to avoid churn.

Signature

@nordcom/commerce-cart
function useCartEvents(type: E, handler: Handler<E>): void;

Parameters

NameTypeDescription
typeE
handlerHandler<E>

CartDevtools CartFormProps CartProviderProps AppCartConfig BaseCartActions BuyerIdentityActions CartActions CartAttributeActions

Metadata@nordcom/commerce-cart@0.2.2Open in GitHub ↗

On this page