BaseCartActions

cart · /react·type

Minimum mutation surface every cart adapter must implement: add, update, and remove cart lines, plus clear to empty every line in one bulk mutation. Serves as the base constraint for and can be used directly when only the core mutations are needed.

clear resolves to a single bulk removal regardless of line count, so callers never have to fan out one removeLine per line to empty the cart.

Properties

addLine
unknown
clear
unknown
removeLine
unknown
updateLine
unknown

Example

function addItem<TExt extends CartExt>(actions: BaseCartActions<TExt>, line: NewCartLine) {
  return actions.addLine(line);
}

CartDevtools CartFormProps CartProviderProps AppCartConfig BuyerIdentityActions CartActions CartAttributeActions CartPredictor

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

On this page