snapshotPredictor
Build a line predictor that derives a predicted cart line directly from the
inline snapshot payload carried on an add-line mutation. Lets callers ship
known merchandise data with the mutation so the optimistic UI doesn't depend
on a separate cache lookup.
Signature
function snapshotPredictor(): LinePredictor;Returns
A that yields Partial<CartLine> for
add-line mutations carrying a snapshot, and null otherwise.
Related
CartDevtools CartFormProps CartProviderProps AppCartConfig BaseCartActions BuyerIdentityActions CartActions CartAttributeActions
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
subtotalPredictor
Build a cartlevel predictor that recomputes cost.subtotal from line unit prices times quantities. Marks costStale: true so consumers can grey out totals until t