CartPredictor
●cart · /react·type
A function that projects the entire cart after a pending mutation has been applied to the lines. Use it to recompute cart-level aggregates — such as total quantity or subtotal — that depend on the mutated line set.
Definition
type CartPredictor = (projection: Cart<TExt>, mutation: CartMutation, ctx: PredictorCtx<TExt>) => Cart<TExt>;(projection: Cart<TExt>, mutation: CartMutation, ctx: PredictorCtx<TExt>) => Cart<TExt>
Example
const predictors = {
cart: [quantitySumPredictor(), subtotalPredictor()],
};Related
CartDevtools CartFormProps CartProviderProps AppCartConfig BaseCartActions BuyerIdentityActions CartActions CartAttributeActions
CartHydrator
Serverrenderable entry point that seeds the clientside cart hydration marker. Delegates to a client component that renders a hidden element carrying the initial
CartProviderProps
Props for . Wires the kernel snapshot, mutation handler, and optional optimistic predictors into the React context tree.