Przejdź do głównej zawartości

Interface: CartRecoveryRunner

Properties

cartClient

readonly cartClient: CartClient

Underlying cart client (for advanced flows / read-only helpers).


cookieStore

readonly cookieStore: CartCookieStore

Underlying cookie store (for advanced flows).

Methods

execute()

execute<T>(operation): Promise<T>

Run any operation through the recovery pipeline.

Type Parameters

T

T

Parameters

operation

CartRecoveryOperation<T>

Returns

Promise<T>


getCart()

getCart(): Promise<CartFragment | null>

Convenience read with auto-cookie-cleanup. Returns the cart or null. If the backend returns CART_NOT_FOUND via userErrors, clears the cookie and resolves null instead of throwing.

Returns

Promise<CartFragment | null>


onExpired()

onExpired(listener): () => void

Subscribe to cart-expired events fired when the runner bails or recreate fails. Returns an unsubscribe function. Multiple subscribers are supported.

Parameters

listener

(event) => void

Returns

() => void