quantitySumPredictor
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
function quantitySumPredictor(): CartPredictor;Returns
A that returns a new cart with the refreshed
totalQuantity and all other fields unchanged.
Related
CartDevtools CartFormProps CartProviderProps AppCartConfig BaseCartActions BuyerIdentityActions CartActions CartAttributeActions
PredictorCtx
Contextual snapshot passed to every and invocation. Predictors use these fields to implement deltaaware projections that compare confirmed versus current projec
snapshotPredictor
Build a line predictor that derives a predicted cart line directly from the inline snapshot payload carried on an addline mutation. Lets callers ship known merc