PredictorCtx
●cart · /react·type
Contextual snapshot passed to every and invocation. Predictors use these fields to implement delta-aware projections that compare confirmed versus current projected state.
Properties
PROPTYPEDESCRIPTION
Example
const myLinePredictor: LinePredictor = (mutation, ctx) => {
const confirmedCount = ctx.confirmed?.totalQuantity ?? 0;
return null; // fall through to the next predictor
};Related
CartDevtools CartFormProps CartProviderProps AppCartConfig BaseCartActions BuyerIdentityActions CartActions CartAttributeActions
PendingMutation
A single mutation in flight through the optimistic queue — from when it is first predicted through server confirmation or failure. status and error are the fiel
quantitySumPredictor
Build a cartlevel predictor that recomputes totalQuantity as the sum of each line's quantity. Pair with line predictors that add or update lines so the cart bad