Przejdź do głównej zawartości

Interface: CartStoreConfig

Properties​

getActions​

getActions: () => CartActions

Getter for DI actions — called on every operation (not captured).

Returns​

CartActions


onExpired?​

optional onExpired?: (event) => void

Called when a stale-cart event terminates an operation:

  • state-dependent — bail-on-stale operation (updateQuantity, removeFromCart) cannot be safely replayed on a new cart.
  • recreate-failed — recovery attempted but creating the replacement cart failed (network / backend error).
  • retry-also-failed — replacement cart also rejected by backend (rare; usually indicates a backend race / bug).

Typical UI usage: subscribe once globally and surface a toast / banner inviting the user to add products again.

Parameters​

event​

CartExpiredEvent

Returns​

void


onMutationError?​

optional onMutationError?: (action, error) => void

Called on mutation error.

Parameters​

action​

CartMutationAction

error​

unknown

Returns​

void


onMutationSuccess?​

optional onMutationSuccess?: (action, cart) => void

Called after successful mutation.

Parameters​

action​

CartMutationAction

cart​

CartData

Returns​

void