CartEventType
●cart · /core·type
Union of the string literal type discriminants for every variant. Use as a constraint when narrowing to a specific event type or when parameterizing .
Definition
type CartEventType = CartEvent['type'];CartEvent['type']
Example
function subscribe(bus: CartEventBus, type: CartEventType) {
return bus.on(type, (event) => console.log(event));
}Related
RunCartAdapterContractOpts runCartAdapterContract CartCapabilityUnsupportedError CartError CartNotFoundError CartProviderError CartUserError CartAdapter
MetadataOpen in GitHub ↗
CartEventHandler
Callback signature for a subscriber to a specific variant. The generic narrows the event parameter to exactly the variant identified by E, so handlers receive s
CartEvent
Discriminated union of every lifecycle event the cart kernel can emit. Consumers subscribe via and switch on event.type to handle the specific variant they care