Skip to main content

Type Alias: TriggerFinishEvent()

TriggerFinishEvent = (variant) => Promise<void>

Function

Function signature for triggering the finish event for a product configuration.

This function initiates the completion process for a product configuration, preparing all the necessary data and dispatching the appropriate events. It's used when a user completes their configuration and is ready to proceed with adding to cart, saving, or sharing.

The variant parameter determines the specific action to take, such as adding to cart, displaying the summary, or generating sharing links.

Which event fires depends on the variant parameter:

Parameters

variant

string

The type of finish action to perform ('basket', 'summary', etc.)

Returns

Promise<void>

Promise that resolves when the finish process is complete

Example

// Trigger the "add to cart" action for the current configuration
triggerFinishEvent('basket');

// Trigger the summary display for the current configuration
triggerFinishEvent('summary');