quantitySumPredictor

cart · /react·function

Build a cart-level predictor that recomputes totalQuantity as the sum of each line's quantity. Pair with line predictors that add or update lines so the cart badge stays in sync during optimistic updates.

Signature

@nordcom/commerce-cart

Returns

A that returns a new cart with the refreshed totalQuantity and all other fields unchanged.

CartDevtools CartFormProps CartProviderProps AppCartConfig BaseCartActions BuyerIdentityActions CartActions CartAttributeActions

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

On this page