snapshotPredictor

cart · /react·function

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

@nordcom/commerce-cart

Returns

A that yields Partial<CartLine> for add-line mutations carrying a snapshot, and null otherwise.

CartDevtools CartFormProps CartProviderProps AppCartConfig BaseCartActions BuyerIdentityActions CartActions CartAttributeActions

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

On this page