PendingMutation

cart · /react·type

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 fields consumers typically use to show per-line loading spinners or inline error messages.

Properties

id
string
mutation
startedAt
number
status
'predicted' | 'in-flight' | 'failed'
error?
string

Example

const pending = useCartPending(lineId);
if (pending && pending.status === 'in-flight') {
  showSpinner();
}

CartDevtools CartFormProps CartProviderProps AppCartConfig BaseCartActions BuyerIdentityActions CartActions CartAttributeActions

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

On this page