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

confirmed
Cart<TExt> | null
projection
Cart<TExt>

Example

const myLinePredictor: LinePredictor = (mutation, ctx) => {
  const confirmedCount = ctx.confirmed?.totalQuantity ?? 0;
  return null; // fall through to the next predictor
};

CartDevtools CartFormProps CartProviderProps AppCartConfig BaseCartActions BuyerIdentityActions CartActions CartAttributeActions

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

On this page